Forum Discussion
Dynamic quantile calculation and matrix marking
- 1 year ago
Hi Klasia,
Thank you for reaching out to the Microsoft Fabric Forum Community.
Thank you pankajnamekar25, for your valuable insights.
I have reproduced the scenario using sample data. Please find the attached pbix file for your reference.
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.
Hello Klasia
You have to create one measure of each calculations.
Median Calculation
Median Time =
CALCULATE(
MEDIAN(Tasks[Time A [s]]),
ALLEXCEPT(Tasks, Tasks[Category])
)
0.25 Quantile Calculation (25th Percentile)
DAX doesn’t have a direct quantile function, but you can create a measure using PERCENTILEX.INC:
Quantile 0.25 =
CALCULATE(
PERCENTILEX.INC(
FILTER(Tasks, NOT(ISBLANK(Tasks[Time A [s]]))),
Tasks[Time A [s]],
0.25
),
ALLEXCEPT(Tasks, Tasks[Category])
)
0.95 Quantile Calculation (95th Percentile)
Quantile 0.95 =
CALCULATE(
PERCENTILEX.INC(
FILTER(Tasks, NOT(ISBLANK(Tasks[Time A [s]]))),
Tasks[Time A [s]],
0.95
),
ALLEXCEPT(Tasks, Tasks[Category])
)
Mark Median
Mark Median =
IF(
SELECTEDVALUE(Tasks[Time A [s]]) = [Median Time],
"Median",
BLANK()
)
Mark Quantile 0.25
Mark Quantile 0.25 =
IF(
SELECTEDVALUE(Tasks[Time A [s]]) <= [Quantile 0.25],
"Quantile 0.25",
BLANK()
)
Mark Quantile 0.95
Mark Quantile 0.95 =
IF(
SELECTEDVALUE(Tasks[Time A [s]]) >= [Quantile 0.95],
"Quantile 0.95",
BLANK()
)
Thanks,
Pankaj Namekar | LinkedIn
If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.