Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have a standard line chart with a trendline that displays almost all of my measures, except for any "TTM" Measures that I have. Non date bound measures work ok, as well as measures that I am using TOTALMTD((QTD),(YTD)) with. Even though I have a consecutive series of months selected in a slicer above, when using the TTM measures, all months in the calendar are displayed. I have been using the chart in published reports for weeks now, but recently updated my calendar table to run completely in query editor, so that I have to make little to no changes in calculated columns. When comparing to my old dataset, I can't seem to find what may be different or what is causing this problem. Also note that in this same report page I have the measures working properly in a table.
TTM Total Sales = CALCULATE ( [Total Sales], DATESBETWEEN ( 'Calendar'[Date], NEXTDAY ( SAMEPERIODLASTYEAR ( LASTDATE ( 'Calendar'[Date] ) ) ), LASTDATE ( 'Calendar'[Date] ) ) )
Solved! Go to Solution.
After doing some more digging Mr. Ferrari at SQLBI was able to help out. Adding this bolded and italicized portion to the forumla did away with the unwanted dates, and is also the most efficient way to make the calculation (compared to an IF statement that would excluded the dates not selected).
@v-yulgu-msft thank you for your help regardless!
TTM Total Sales = DIVIDE( [Total Sales], [Total Sales] ) * CALCULATE ( [Total Sales], DATESBETWEEN ( 'Calendar'[Date], NEXTDAY ( SAMEPERIODLASTYEAR ( LASTDATE ( 'Calendar'[Date] ) ) ), LASTDATE ( 'Calendar'[Date] ) ) )
Hi @bdurham15,
Please set the X-axis type to Categorical for a test.
regards,
Yuliana Gu
@v-yulgu-msft, thank you for your response, unfortunately this does not correct the issue.
After doing some more digging Mr. Ferrari at SQLBI was able to help out. Adding this bolded and italicized portion to the forumla did away with the unwanted dates, and is also the most efficient way to make the calculation (compared to an IF statement that would excluded the dates not selected).
@v-yulgu-msft thank you for your help regardless!
TTM Total Sales = DIVIDE( [Total Sales], [Total Sales] ) * CALCULATE ( [Total Sales], DATESBETWEEN ( 'Calendar'[Date], NEXTDAY ( SAMEPERIODLASTYEAR ( LASTDATE ( 'Calendar'[Date] ) ) ), LASTDATE ( 'Calendar'[Date] ) ) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |