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,
I need to compute for summary stats - Median, Max, Min, 10th percentile and 90th percentile per plan. Here is how the data works:
Data:
Cust | Plan Variant | Plan Desc |
1 | A | A.1 |
1 | A | A.1 |
1 | A | A.2 |
1 | B | B.1 |
2 | B | B.2 |
2 | C | C.1 |
Customer can have multiple plan variant. A plan variant can have multiple plan description.
Goal:
I want to be able to compute for averages, medians, etc. for every plan description filter. But if I want to not select only any plan description, it will show the summary stats of the plan variant.
Solved! Go to Solution.
Hi @Anonymous ,
Please create a new table first:
Table 2 = DISTINCT('Table'[Plan Desc])
and use this field to the slicer. Then please create measures like:
Measure =
VAR _slicer = SELECTEDVALUE('Table 2'[Plan Desc])
VAR _filter = IF(MAX('Table'[Plan Desc])=_slicer||_slicer=BLANK(),1)
RETURN
_filter
Average of ARPU =
IF(
ISFILTERED('Table 2'[Plan Desc]),
CALCULATE(
AVERAGE('Table'[ARPU]),
ALLEXCEPT('Table','Table'[Plan Desc])
),
CALCULATE(
AVERAGE('Table'[ARPU]),
ALLEXCEPT('Table','Table'[Plan Variant])
)
)
Median of ARPU =
IF(
ISFILTERED('Table 2'[Plan Desc]),
CALCULATE(
MEDIAN('Table'[ARPU]),
ALLEXCEPT('Table','Table'[Plan Desc])
),
CALCULATE(
MEDIAN('Table'[ARPU]),
ALLEXCEPT('Table','Table'[Plan Variant])
)
)
Result:
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Hi @Anonymous ,
Please create a new table first:
Table 2 = DISTINCT('Table'[Plan Desc])
and use this field to the slicer. Then please create measures like:
Measure =
VAR _slicer = SELECTEDVALUE('Table 2'[Plan Desc])
VAR _filter = IF(MAX('Table'[Plan Desc])=_slicer||_slicer=BLANK(),1)
RETURN
_filter
Average of ARPU =
IF(
ISFILTERED('Table 2'[Plan Desc]),
CALCULATE(
AVERAGE('Table'[ARPU]),
ALLEXCEPT('Table','Table'[Plan Desc])
),
CALCULATE(
AVERAGE('Table'[ARPU]),
ALLEXCEPT('Table','Table'[Plan Variant])
)
)
Median of ARPU =
IF(
ISFILTERED('Table 2'[Plan Desc]),
CALCULATE(
MEDIAN('Table'[ARPU]),
ALLEXCEPT('Table','Table'[Plan Desc])
),
CALCULATE(
MEDIAN('Table'[ARPU]),
ALLEXCEPT('Table','Table'[Plan Variant])
)
)
Result:
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |