Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
In the first measure, I'm trying to compute the average quarterly sales and next measure the average montly sales in each year. In the first mesure, i should be getting the year level value in the quarter level as well since there is an ALL function around the quarter column, but why am i getting this result. Same issue with the second measure. Any reason why this is happening
Solved! Go to Solution.
Hi @Cyriackpazhe,
Thank you for reaching out to the Microsoft fabric community forum. Thank you @some_bih, for your inputs on this issue.
Thank you for bringing this to my attention. Upon reviewing your DAX measures, I noticed the inconsistency in average quarterly and monthly sales across different periods, even with the ALL() function applied.
This occurs because ALL('Calendar'[Quarter]) or ALL('Calendar'[Month]) only removes the filter for that specific column. However, in a matrix visual with a hierarchy (such as Year > Quarter or Year > Month), the row-level filters from the visual still affect the context, resulting in varying outcomes for each row.
To ensure the calculation is performed at the year level and the same value is displayed across quarters or months in the matrix, you can use the following DAX measures with ALLEXCEPT, which retains only the Year filter:
Quarterly Average:
DAX
CopyEdit
Quarterly Average =
CALCULATE (
AVERAGEX (
VALUES ( 'Calendar'[Quarter] ),
[Total Sales]
),
ALLEXCEPT ( 'Calendar', 'Calendar'[Year] )
)
Monthly Average:
DAX
CopyEdit
Monthly Average =
CALCULATE (
AVERAGEX (
VALUES ( 'Calendar'[Month] ),
[Total Sales]
),
ALLEXCEPT ( 'Calendar', 'Calendar'[Year] )
)
ALLEXCEPT clears all filters from the Calendar table except for Year, so the average is always calculated at the year level just as intended. This approach avoids row context interference from the visual (like month or quarter rows).
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
Hi @Cyriackpazhe,
Thank you for reaching out to the Microsoft fabric community forum. Thank you @some_bih, for your inputs on this issue.
Thank you for bringing this to my attention. Upon reviewing your DAX measures, I noticed the inconsistency in average quarterly and monthly sales across different periods, even with the ALL() function applied.
This occurs because ALL('Calendar'[Quarter]) or ALL('Calendar'[Month]) only removes the filter for that specific column. However, in a matrix visual with a hierarchy (such as Year > Quarter or Year > Month), the row-level filters from the visual still affect the context, resulting in varying outcomes for each row.
To ensure the calculation is performed at the year level and the same value is displayed across quarters or months in the matrix, you can use the following DAX measures with ALLEXCEPT, which retains only the Year filter:
Quarterly Average:
DAX
CopyEdit
Quarterly Average =
CALCULATE (
AVERAGEX (
VALUES ( 'Calendar'[Quarter] ),
[Total Sales]
),
ALLEXCEPT ( 'Calendar', 'Calendar'[Year] )
)
Monthly Average:
DAX
CopyEdit
Monthly Average =
CALCULATE (
AVERAGEX (
VALUES ( 'Calendar'[Month] ),
[Total Sales]
),
ALLEXCEPT ( 'Calendar', 'Calendar'[Year] )
)
ALLEXCEPT clears all filters from the Calendar table except for Year, so the average is always calculated at the year level just as intended. This approach avoids row context interference from the visual (like month or quarter rows).
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
Hi @Cyriackpazhe,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @Cyriackpazhe,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @Cyriackpazhe,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.
Hi @Cyriackpazhe try this version for your measure
Quarterly Average Test =
AVERAGEX(
VALUES('Calendar'[Date]),
CALCULATE([Total], ALL('Calendar'[Date]))
)
Proud to be a Super User!
But what was the error with what i wrote??
It was supposed to give the result as expected right
measure might aggregate values across all quarters rather than respecting the context of year and quarter
Proud to be a Super User!
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
25 | |
10 | |
7 | |
6 | |
6 |
User | Count |
---|---|
30 | |
11 | |
11 | |
10 | |
6 |