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.
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])-12
The 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?
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 |
---|---|
107 | |
99 | |
76 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |