Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi ,
I want to have ranking based on TOPN parameter selection . If i select 3 in Top N RES Parameter then it should show be top 3 Responsible Legal Entity based on measure [#OnlyOpen]. The below calculation is working perfectly fine but the issue i am facing is performance . If i select any other number in the parameter TOP N RES then the table is loading for data for more than 1 min . How can i optimize this dax calculation for increasing the performance .
| Responsible Legal Entity | Only Open |
| ABC | 4 |
| CDE | 5 |
| FGH | 7 |
| IJK | 6 |
| MNO | 9 |
| PQR | 10 |
Solved! Go to Solution.
Hi @nish18_1990 ,
Please try below measures.
Measure 1: Top N Responsible (Boolean filter).
Top N RES Flag =
VAR N =
SELECTEDVALUE ( 'Top N RES Parameter'[Top N RES Parameter Value], 0 )
VAR TopNTable =
TOPN (
N,
ALL ( 'My_Main_Table'[Resp Risk Unit Level 2 Name] ),
[#OnlyOpen], DESC
)
RETURN
IF (
MAX ( 'My_Main_Table'[Resp Risk Unit Level 2 Name] ) IN TopNTable,
1,
0
)
Measure 2: Final Result
Top N RES =
IF ( [Top N RES Flag] = 1, [#OnlyOpen] )
If my response as resolved your issue please mark it as solution and give kudos.
Thanks,
Dinesh
Hi @nish18_1990
Thank you for reaching out to the Microsoft Fabric Forum Community.
@parry2k @Anonymous Thanks for the inputs.
I hope the information provided by users was helpful. If you still have questions, please don't hesitate to reach out to the community.
Hi @nish18_1990
Hope everything’s going smoothly on your end. I wanted to check if the issue got sorted. if you have any other issues please reach community.
Yes you replace _Top variable with your dynamic selected top value, something like this
__Top = [Dynamic Top Measure]
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi @nish18_1990 ,
Please try below measures.
Measure 1: Top N Responsible (Boolean filter).
Top N RES Flag =
VAR N =
SELECTEDVALUE ( 'Top N RES Parameter'[Top N RES Parameter Value], 0 )
VAR TopNTable =
TOPN (
N,
ALL ( 'My_Main_Table'[Resp Risk Unit Level 2 Name] ),
[#OnlyOpen], DESC
)
RETURN
IF (
MAX ( 'My_Main_Table'[Resp Risk Unit Level 2 Name] ) IN TopNTable,
1,
0
)
Measure 2: Final Result
Top N RES =
IF ( [Top N RES Flag] = 1, [#OnlyOpen] )
If my response as resolved your issue please mark it as solution and give kudos.
Thanks,
Dinesh
@nish18_1990 try this:
Top N =
VAR __Top = 5
RETURN
CALCULATE (
SUM ( TopTest[Only Open ] ),
KEEPFILTERS (
TOPN (
__Top,
ALLSELECTED ( TopTest ),
CALCULATE ( SUM ( TopTest[Only Open ] ) )
)
)
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hi ,
I need dynamic parameter selection for Top N . Like if i select 3 then show me 3 res , if i select 5 then show me 5 res
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 23 | |
| 13 | |
| 10 | |
| 6 | |
| 5 |