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 got a 12 month trend working. I was wondering how to display that in a trend chart. If I filter the data for the chart to be from Jan-2018 to Current, the first month doesn't have the last 12 months to calculate. Only 12 months into the trend chart is the data accurate. I'm probably in the weeds on this one and it's just something simple I'm missing. Below is my formula. I also tried a last two years filter with the underlying data going back to 2017. Any filter also filters the data used in for the 12 month calculaton
Solved! Go to Solution.
I figured out one way to do it. Pre-Calculate the 12 month totals before using a calculated measure in Power BI. Make sure you have a year's worth prior to the begining time frame of your chart. Here's some example SQL to calculate last 12 but including the current month.
Not very clear , but if you want every month to last 12 month sum or Avg
Try Like
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-12,MONTH))
Rolling 12 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date Filer],MAX(Sales[Sales Date]),-12,MONTH))
For Average change aggregation of Measure
Thank You! I haven't asked many tech questions and this is my first here. Is that two calcs below, so I should pick one?
Check out the hypothetical chart below. The underlying data goes to 1-1-2017. I have added a filter to the chart to only have 2020 and 2019. Starting in Jan-19 it starts to reduce by the amount of sales per month. So filtering the data also filters the 12 months used in the Moving Total. I was wondering if there's a way to still do this.
I figured out one way to do it. Pre-Calculate the 12 month totals before using a calculated measure in Power BI. Make sure you have a year's worth prior to the begining time frame of your chart. Here's some example SQL to calculate last 12 but including the current month.
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 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |