Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi,
I have a matrix with 4 levels, the fist level comes from a column of the date dim and the remainig 3 levels are from the produt dimension, i also have a measure called und sale wich is the sum of the sale units
What i want is to take the average, tha is, for my hormonal group the units of all the available months are added and divided by two (the average) then the same for the anti-pain group and so on for the others groups and the same for the others levels of hierarchy
I have usued these dax:
Hi @Yeimy ,
I created some data:
Are you referring to the different levels of Row subtotals showing the average for that level.
Measure follows the context of the "Total" row and is calculated in that context. Therefore, using a measure in a column of a table visualization may have unexpected values in the "Total" column.
You can consider using the switch() + Isinscope() function to determine the corresponding level in the matrix, and use the corresponding rule based on the corresponding level
SWITCH function (DAX) - DAX | Microsoft Learn
ISINSCOPE function (DAX) - DAX | Microsoft Learn
Here are the steps you can follow:
1. Create measure.
Measure =
SWITCH(
TRUE(),
ISINSCOPE('Table'[Group4]),1,
ISINSCOPE('Table'[Group3]),2,
ISINSCOPE('Table'[Group2]),3,
ISINSCOPE('Table'[Group1]),4,0)
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thank you,
But that doesn't solve my problem
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
69 | |
35 | |
21 | |
18 | |
15 |
User | Count |
---|---|
128 | |
29 | |
27 | |
24 | |
22 |