Forum Discussion
Add percentiles using a calculated measure
What's wrong with PERCENTILEX.INC - DAX Guide?
By the way, it's still not clear what you mean by a "percentile measure." A percentile is a 2-variable function , f(x: Multiset(R), y: R) -> R , that depends on: (x) the data set you give it and (y) the threshold you define between 0 and 1. So I'm still unable to determine exactly what you really want. Which exactly percentile are you talking about? For instance, if you want the 25th percentile (the 1st quartile) for cities based on some [M]easure calculated for the cities, then you'd write:
percentilex.inc(
summarize(
FactTable,
Cities[CityID]
),
[M],
0.25
)
If you want the same but just for countries, then you'd need to change Cities[CityID] to some kind of Country[CountryID]. If you want to have percentiles for different levels of a hierarchy, then you'll have to create a specific measure for this very hierarchy using ISINSCOPE and a proper formula for each level...
What I am trying to do is to have in which percentile all those cities are. For example, if they are in the top 90% it would be 0.9.
- Anonymous4 years agoNot applicable
Are you trying to create a measure or a calculated column? It's not obvious. By the way, you cannot write a measure that would return just one number for a set of cities to inform you in what percentile they all are. This question is ill-posed. You should really think hard about what it is you want to do and then carefully describe it here.