Forum Discussion
Percentile category
How do you get overall TotalProfitMargin in the bottom row of 81.09%???
In the sample I created I get 40.98%
Sean Ah, yeah... that's actually the MAX (used MAX for my simple measure). Probably should've just removed that, but I wasn't paying attention.
- Sean10 years agoCommunity Champion
Okay I didn't think about this - that makes sense now!
- ThomasDay10 years agoImpactful Individual
Yes, the typo nailed me...I stared at that for a long time and figured it out...then tried to remove my post so not to bother folks. Anyway, it worked great, eh?
- pat_energetics10 years agoAdvocate II
Further to this example, is there a way of using a measure result directly in the "K" argument of the percentile function?
Where in the following example; 'Band' is a 10 row table with columns [BandNumber] of values 1-10 and [K Perc] of values 0, 0.1, 0.25, 0.45, 0.5, 0.55, 0.75, 0.9, 0.95, 1
eg K Perc Result := IF(HASONEVALUE(Band[K Perc]),VALUES(Bands[K Perc]),0.5)
PercentileBandResult:= CALCULATE
(PERCENTILEX.INC(FactTable, FactTable[Column],[K Perc Result]), // other filters, //)
or should a VARiable be used within the measure to explicitly return a value to the percentile function e.g
VAR
KValue = IF(HASONEVALUE(Band[K Perc]),VALUES(Band[K Perc]),SWITCH (Band[K Perc],
"0" = 0,
"0.1" = 0.1,
etc,
etc,
"1" = 1,
//if all the above fail //,0.5)
RETURNPercentileBandResult:= CALCULATE
(PERCENTILEX.INC(FactTable, FactTable[Column],KValue, // other filters, //)