Forum Discussion
Optimize the dax query for TOP N parameter
- Anonymous10 months ago
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.
- Anonymous10 months agoNot applicable
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.