Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
Is there a way to add a trend line using a month year column (mmmm yyyy). The Month Year column is calculated from the SAMPLE DATE column.
The below is the query to calculate the trend -
Thanks
Solved! Go to Solution.
Hi @yaman123 ,
This post will help you: Use Custom DAX to create a Linear Regression Trendline with a Dynamic Date Hierarchy in Power BI - M....
It create a trend line by week-year. And here is the corresponding video:
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @yaman123 ,
This post will help you: Use Custom DAX to create a Linear Regression Trendline with a Dynamic Date Hierarchy in Power BI - M....
It create a trend line by week-year. And here is the corresponding video:
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Set up a date table linked to the sample date column and then in your measure definition replace every mention of the sample date column with the column from your date table which you are using in the visual - e.g. 'Date'[Year month].
Its important that the column used in the trend line measure matches exactly with the column you are using as the axis
hI @johnt75
I get the below error when changing the measure definitions and adding the new column as the X axis?
My new measure -
Try changing the Date Month Year column to be of type date. If you store it as 01/mm/yyyy then you can set the format string to display just month and year, it should give the results you're looking for
Still not giving me the results unfortunately
Date Month column is -
The only other thing I can suggest is trying
Date Month Year = DATE( YEAR('Date Table'[Date]), MONTH('Date Table'[Date]), 1)
Other than that, your code appears to be the same as what I have used for trend lines in the past.
User | Count |
---|---|
92 | |
85 | |
77 | |
66 | |
62 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
59 |