Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Klasia
Frequent Visitor

Dynamic quantile calculation and matrix marking

Hi. I have in my Power BI matrix, where from each category and type I want show in which row i have median and quantiles (0,25; 0,95).
All value in time I have coating in measure because must be dinamic, depence what you choose in filters

 

My matrix:

TypCategoryTaskTime A [s]
Type A   
 Category A 
  Task 125
  Task 236
  Task 320
 Category B  
  Task 110
Type B   
 Category C  
  Task 15
  Task 23
  Task 38
  Task 420
  Task 59
  Task 617

 

And I Want add columns like

TypCategoryTaskTime A [s]MedianQuantile 0.25Quantile 0.95
Type A      
 Category A    
  Task 125MedianQuantile 0.25 
  Task 236  Quantile 0.95
  Task 320   
 Category B     
  Task 110MedianQuantile 0.25Quantile 0.95
Type B      
 Category C     
  Task 15 Quantile 0.25 
  Task 23   
  Task 38Median  
  Task 420   
  Task 59   
  Task 617  Quantile 0.95

 

I don't know how to compare values ​​at the task level with the value calculated at the category level

 

 

1 ACCEPTED SOLUTION

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.

View solution in original post

6 REPLIES 6
v-saisrao-msft
Community Support
Community Support

Hi @Klasia,
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.

Klasia
Frequent Visitor

Thanks @pankajnamekar25 , but I don't know what I do wrong in Median Time, because show me wrong value

Klasia_0-1743662980540.png

And I do exactly how you wrote

 

EDIT: I chage ALLEXCEPT to  ALLSELECTED and now working. 

Hi @Klasia,

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 @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.

Hi @Klasia,

 

We haven’t heard back from you regarding your issue. If it has been resolved, please mark the helpful response as the solution and give a ‘Kudos’ to assist others. If you still need support, let us know.

 

Thank you.

pankajnamekar25
Super User
Super User

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.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.