Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All,
I am trying to create a rolling year (sum of retail of last 12 months) based on index (NOT on date, I don't have dates like in the example!) for each location seperate but haven't quite got what I want. Right now I am using 2 querries but the second one is giving an error.
First one calculates the starting month of the rolling year, so the max index (this month) - 12 months
Rolling Year Index = MAX('Retail'[Index])-12The second one should SUM the retail figures if the index of the row is larger than the outcome of the measure above.
Rolling Year = CALCULATE(sum('Retail'[Retail Value]);'Retail'[Index]>[Rolling Year Index])But I get a error that a true/false expression is used with calculate.@MxJ ,
You may add FILTER Function to the formula.
https://www.sqlbi.com/articles/filter-arguments-in-calculate/
Thanks for your response! Unfortunatly I am not getting it to work with filter..
Rolling Year Index = MAX('Retail'[Index])-12
Rolling Year retail= CALCULATE(sum('Retail'[Value]);FILTER(ALL('Retail'[Index]);'Retail'[Index]>[Rolling Year Index]))
It just sums everything, also before the last 12 months. Am I doing something wrong?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |