Forum Discussion
Vinagre01
1 year agoFrequent Visitor
Calculate Percentile Splitting Data Into One Column Instead of Many
I have a table with the following template: cisp month type total 1 Jan A 15 2 Jan A 20 1 Jan B 30 2 Jan B 40 1 Feb A 50 2 Feb A 60 1 Feb B 70 2...
- Anonymous1 year ago
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:
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
Anonymous
1 year agoNot 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:
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
Vinagre01
1 year agoFrequent Visitor
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!!!