Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
My source data is following
| Name | Value |
| P1 | 100 |
| P2 | 200 |
| P3 | 300 |
| P4 | 400 |
| P5 | 500 |
| P6 | 600 |
From here, I want to come here
| Name | Value |
| P3 | 300 |
| P1 | 100 |
| P2 | 200 |
which can be achieved by creating a
newTable = TOPN(3,'Fact','Fact'[Name],ASC)
Now, I want to acheive the following by using it inside a measure and I could not make it to work.
Can someone please point me to the correct direction.
Thank you in advance.
topn = SUMX(TOPN(3,'Fact','Fact'[Name],ASC),'Fact'[Value])
Hi @smpa01 ,
Try this measure
rank =
SUMX (
FILTER (
'Fact',
RANKX ( ALL ( 'Fact' ), CALCULATE ( MAX ( 'Fact'[Name] ) ),, ASC, DENSE ) <= 3
),
[Value]
)
You can check more details from here.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous thanks for looking into this. I know how to get to the desired result using RANKX. I was trying to see if I can get there using TOPN.
@amitchandakthanks for looking into this. It did not work
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |