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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Vinagre01
Frequent Visitor

Calculate Percentile Splitting Data Into One Column Instead of Many

I have a table with the following template:

 

cispmonthtypetotal
1JanA15
2JanA20
1JanB30
2JanB40
1FebA50
2FebA60
1FebB70
2FebB80

 

If I do a simple percentile calculation like:

 

percentile = PERCENTILE.INC(BaseDPEvolucaoMensalCisp[total], 1)

 

I will logically obtain 80 as a result.

 

What I'm trying to accomplish is to have my percentiles calculated taking into account only a CISP column segregation, meaning that the percentile would have to be calculated from a table like this:

 

cisptotal
1165
2200

Then logically, my percentile calculation would return 200.

 

What I have tried is calculating the percentile from a calculated DAX table like this:

 

Summ_table = 
SUMMARIZE(
    BaseDPEvolucaoMensalCisp, 
    BaseDPEvolucaoMensalCisp[cisp], 
    "Total", SUMX(BaseDPEvolucaoMensalCisp,BaseDPEvolucaoMensalCisp[total])
)

 

However the problem is that, even if I create a one to many relationship, this newly calculated table won't be recalculated in case I filter the original "BaseDPEvolucaoMensalCisp" table (and it seems like this is intended behavior). This would be really important as I will need to recalculate my percentile with a "month" and/or "type" filter.

 

Example with "type" filter (B):

 

cisptotal
1100
2120

Then my percentile calculation would return 120.

 

I have tried both the forementioned method of calculating a new DAX table and then calculating the percentile, as well as playing a lot with the CALCULATE function, but I don't seem to get it right.

 

Thank you for your help.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Vinagre01 ,

 

Here are the steps you can follow:

1. Create measure.

 

Measure = 
var _select=SELECTEDVALUE('Table'[type])
return
var _table1=
FILTER(
    ALL('Table'),[type]=_select)
var _table2=
SUMMARIZE(
    _table1,[cisp],"Value",SUM('Table'[total]))

RETURN
PERCENTILEX.INC(_table2,[Value],1)

 

2. Result:

vyangliumsft_0-1729129670572.png

 

 

Best Regards,

Liu Yang

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

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Very confused about what you want.  WIth your measure

percentile = PERCENTILE.INC(Data[total],1)

i get this

Ashish_Mathur_0-1729132538998.png

 

What is the problem?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi  @Vinagre01 ,

 

Here are the steps you can follow:

1. Create measure.

 

Measure = 
var _select=SELECTEDVALUE('Table'[type])
return
var _table1=
FILTER(
    ALL('Table'),[type]=_select)
var _table2=
SUMMARIZE(
    _table1,[cisp],"Value",SUM('Table'[total]))

RETURN
PERCENTILEX.INC(_table2,[Value],1)

 

2. Result:

vyangliumsft_0-1729129670572.png

 

 

Best Regards,

Liu Yang

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

Amazing @Anonymous !

 

I had to tweak a bit because I might need to use multiple values as a filter, so in the end it looked something like this:

 

Measure = 
var _select=VALUES('Table'[type])
return
var _table1=
FILTER(
    ALL('Table'),[type] IN _select)
var _table2=
SUMMARIZE(
    _table1,[cisp],"Value",SUM('Table'[total]))

RETURN
PERCENTILEX.INC(_table2,[Value],1)

 

Thanks a lot!!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.