Forum Discussion
gwolszczak
2 years agoFrequent Visitor
TOPN Measure Doesn't Work as Expected
Hello,
I am working on a solution of dynamic segmention of outlets, based on the Volume of Sales measure.
I need to group the outlets into
Top 10% with highest Volumes, another 20%, 30% & 40%.
I came up with the following formula to get 10% with highest Volumes:
Volume Top10% =
SUMX(
TOPN(2529,SUMMARIZE(fact_DIS, fact_DIS[Outlet ID], "Vol", [Volume]), [Vol], DESC),
[Vol]
)
That almost seems to work. My top 10% is equal to 2529 (just temporary, static solution) ~ to 119,109.61 of Volumes. The below screenshot shows:
That almost seems to work. My top 10% is equal to 2529 (just temporary, static solution) ~ to 119,109.61 of Volumes. The below screenshot shows:
- Top Visual: the standard Volume measure value on a visual with Visual Filter TopN FIlter
- BottomVisual: the Volume Top 10% measure value with a definition as above.
The totals are equal, however the individual values are not, what is more - the bottom part doesn't add up to the total. How to solve it?
1 Reply
- AnonymousNot applicable
Hi gwolszczak,
Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng