March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi there,
I have got six years of data. Its regulatory year starts on 1st April and finishes on 31st March. I want to calculate the cumulative average of the sum on a monthly basis for the last 5 years (don't want to include the current year). I am doing the following steps to calculate:
Calculate the sum of value using following measure:
As you can see that cumulative Norm Value does not cumulative add Average Normalised Value. I am not sure where I made the mistake. Could anyone help me in fixing the issue?
Solved! Go to Solution.
Hi @Dunner2020,
According to your description, It sounds like you want to apply multiple aggregates on measure calculation, right?
IF that is the case, I'd like to suggest you add a variable with summarize function to apply the first aggregation, then you can use iterator functions to invoke the above variable table to calculate the second aggregate.
Measure Totals, The Final Word
measure =
VAR summary =
SUMMARIZE ( Table, [category 1], [category 2], "AVG", AVERAGE ( Table[Amount] ) )
RETURN
SUMX ( summary, [AVG] )
Regards,
Xiaoxin Sheng
Hi @Dunner2020,
According to your description, It sounds like you want to apply multiple aggregates on measure calculation, right?
IF that is the case, I'd like to suggest you add a variable with summarize function to apply the first aggregation, then you can use iterator functions to invoke the above variable table to calculate the second aggregate.
Measure Totals, The Final Word
measure =
VAR summary =
SUMMARIZE ( Table, [category 1], [category 2], "AVG", AVERAGE ( Table[Amount] ) )
RETURN
SUMX ( summary, [AVG] )
Regards,
Xiaoxin Sheng
"I want to calculate the cumulative average"
That's not a thing. Did you mean to say: "I want to calculate the average of the monthly sums" ?
Your AVERAGEX measure is missing the monthly bucketing.
Which average are you trying to compute? Across all months regardless of year?
What would be the expected result?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
127 | |
82 | |
69 | |
53 | |
44 |
User | Count |
---|---|
202 | |
106 | |
100 | |
64 | |
56 |