Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
67 |