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.
I've found several articles that touch on different ways to do this but I was curious.
Is there a way we can take the steps that this SQLJason has done (which is great).
If you want an example dataset the below link has one you can download that is just like mine. Except I want to do a rolling sum on the rolling graph he has.
But then do a Rolling on top of the rolling he is doing. So basically I want to have rolling 3 month Sales that Rolls 12 months. So my trend line would have:
Month Rolling 3 Month Sum Sales Sales Dec 3000 1000 Nov 3200 500 Oct 2700 1500 Sept 2750 1200 etc....
This is my code I would like to show the Rolling Sum of Sales for each of the above months in a single Trend Line. However, when I put this measure into a graph it simply shows the last 3 months of Sales broken out.
Rolling Sales 3 Month Total = CALCULATE ( 'Measures Fact'[Sales], DATESINPERIOD ( 'DIMCalendar'[Date], LASTDATE ( ('DIMCalendar'[Date] ) ), -3, MONTH ) )
This is the code that works in simply showing the last "N" months of Sales (from the above link):
Sales(last n months) = CALCULATE ( SUM ( FactSales[Sales] ), DATESINPERIOD ( 'DIMCalendar'[Date], MAX ( 'DIMCalendar'[Date] ), - [N Value], MONTH ) )
Hi @Anonymous ,
Have you noticed that "It is important to know that putting the Month from the Date table will not work, so what we are going to do is create a month column in the Sales table and then use that as the axis for the bar chart.", which is mentioned in above link?
Regards,
Yuliana Gu
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 |
---|---|
114 | |
100 | |
78 | |
75 | |
52 |
User | Count |
---|---|
144 | |
109 | |
108 | |
88 | |
61 |