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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

How to get a percentile/quartile when I have a measure with the values to measure and not a table

Hello Everyone, 

 

I want to calculate the percentile or quartile of an item. I used a formula posted in this forum and it works however, I need to modify it since my values are not stored in a table but in a measure.

 

See below formula :

*In the below example, I need to modify the formula to successfully substitute the column reference of  'Sales'[SalesAmount] withmy measure called [SalesAmount] (Where I have the values stored to help me in the calculation of percentile/quartile)

 

Quartile =
VAR SelectedUnit =
SUM ( 'Sales'[SalesAmount])
VAR p25 =
PERCENTILEX.INC (
ALLSELECTED ( 'Item'[Item Number] ),
CALCULATE ( SUM ( 'Sales'[SalesAmount]) ),
0.25
)
VAR p50 =
PERCENTILEX.INC (
ALLSELECTED ( 'Item'[Item Number] ),
CALCULATE ( SUM ( 'Sales'[SalesAmount] ) ),
0.5
)
VAR p75 =
PERCENTILEX.INC (
ALLSELECTED ( 'Item'[Item Number] ),
CALCULATE ( SUM ( 'Sales'[SalesAmount]) ),
0.75
)
RETURN
SWITCH (
ISFILTERED('Item'[Item Number]),
SelectedUnit <= p25, "Low",
SelectedUnit > p25
&& SelectedUnit <= p50, "Mid",
"High"
)
 
Thank you in advance for your help!
1 REPLY 1
v-xiaosun-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can try to use SUMX funtion to replace SUM function in your formula as below. Here, measure is  your measure called [SalesAmount] .

 

SUMX('Sales','Sales'[Measure] )

 

vxiaosunmsft_0-1671097538849.png

 

Best Regards,
Community Support Team _ xiaosun

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.