A quick blog post on finding where the trend line is hiding in Power BI Desktop. Docs will state it is in the analytics pane for certain types of visualization. However, it doesn’t always show up:
(I really resisted the urge to post another “Dude, where is my car” image)
So why did the trend line disappear? Turns out the X-axis needs to be continuous, not categorical. You can change this in the properties of the X-axis:
However, still no trend line. This was caused by the effect that the attribute Year in my model had a string data type, and not integer (because why would I want to aggregate years?). Once I changed it to whole number in the query editor, my problem was solved:
(Still no percentile line though…)
This restriction of “continuous and numerical” means you can’t for example use a Year-Month column (e.g. 2017-06). I hope they solve this soon.
I was asked to do a review of the book Microsoft Power BI Performance Best…
This is a quick blog post, mainly so I have the code available if I…
Praise whatever deity you believe in, because it's finally here, a tenant switcher for Microsoft…
This book was making its rounds on social media, and the concept seems interesting enough…
I'm hosting a free webinar at MSSQLTips.com at the 19th of December 2024, 6PM UTC.…
The slides and scripts for my session "Tackling the Gaps & Islands Problem with T-SQL…
View Comments
can you show the trend line year and month wise
I'm not sure what you mean. I think you can have a trend line when you have a date hierarchy and you drill down to months? I'd have to test it out.
Didn't get your point at all. Can you tell me in very simple terms which line is the trend line? The green or the black dotted one?
The black dotted one.
"Once I changed it to whole number in the query editor, my problem was solved:" Can you give a screenshot of how to do this? I only see the options to change the entire field's data type, not just the year attribute. Thanks!
What do you mean with the "entire field"?
Do you have a auto-created data hierarchy?
One other issue I found is that the trend lines goes when there is no data on the chart. Let's say I have a chart with months the my data starts in March and continues to the rest of the year. The trend line starts at January even though there is no data for January and February. I do not want it and want the line to start at March. Do not see any setting for that.