Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hey everyone. Sorry super new to posting. I have a measure that supposed to return the top 10 values of a table I'm working with (using Calculate and TopN). I have another measure that just aggregates values (using Count). However, as seen on the matrix table screenshot I attached here, the TOPN measure returns the same values as my other measure. Any idea why the TOPN isn't filtering the calculation? TIA
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file whether it suits your requirement.
Sales: =
SUM(data[sales])
% top 3 sales: =
VAR _allsales =
CALCULATE ( [Sales:], ALL ( data[category] ) )
VAR _topsales =
CALCULATE ( [Sales:], TOPN ( 3, ALL ( data[category] ), [Sales:], DESC ) )
RETURN
DIVIDE ( _topsales, _allsales )
Thanks for the reply from Jihwan_Kim.
Hi @harmon-tuazon ,
Here I have another idea in mind, and I would like to share it for reference.Sample data is as follows:
1.Create two measure:
#Meal Kits = COUNT(financials[Index])
#Top 10 Meal Kits Ordered =
VAR _p =
SELECTEDVALUE ( financials[Product] )
RETURN
MAXX (
FILTER (
TOPN (
3,
SUMMARIZE (
ALLSELECTED ( financials ),
'financials'[Product],
"Top",
CALCULATE (
COUNT ( 'financials'[Index] ),
ALLEXCEPT ( financials, financials[Product] )
)
),
[Top], DESC
),
'financials'[Product] = _p
),
[Top]
)
2.The top three product totals were successfully obtained using the measure just created.
Best Regards,
Zhu
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi,
I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file whether it suits your requirement.
Sales: =
SUM(data[sales])
% top 3 sales: =
VAR _allsales =
CALCULATE ( [Sales:], ALL ( data[category] ) )
VAR _topsales =
CALCULATE ( [Sales:], TOPN ( 3, ALL ( data[category] ), [Sales:], DESC ) )
RETURN
DIVIDE ( _topsales, _allsales )
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
23 | |
10 | |
10 | |
9 | |
7 |