Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi, I need to display Top N reason for the month based to below data model in power BI. Tables: Date ([fulldate,date],[ReportMonth varchar(50) format mmmyy]) ,Reason ([ReasonDate,date],[Reason varchar(500)] The top filter should display top 3 reasons for the month using DAX.It should not display the top 3 reasons on overall count. The filter will be on ReportMonth column to find the top 3 reasons.Appreciate any help.
Solved! Go to Solution.
Hi All,
I used the Intersect with values on the DAX measure for both of the above tables and it worked for me.
ReasonCount=Calculate(Count(Reason),Intersect(Values(Reason),Values(Date)))
Be careful with the table sequence in intersect they incur different results for different combination.Intersect(T1,T2) is not equal to Intersect(T2,T1).
Thanks.
Top 3 reasons by what? count ? another field?
Hi,
Those are by count of reason for a particular month.
This works for me:
Measure =
var m=SELECTEDVALUE('Table'[Month])
var v=SUMMARIZE(FILTER(ALLSELECTED('Table'),'Table'[Month]=m),'Table'[Reason],"Ct",count('Table'[Reason]))
var t=TOPN(3,v,[Ct],DESC)
var r= CONCATENATEX(t,[Reason],",")
return r
Hi All,
I used the Intersect with values on the DAX measure for both of the above tables and it worked for me.
ReasonCount=Calculate(Count(Reason),Intersect(Values(Reason),Values(Date)))
Be careful with the table sequence in intersect they incur different results for different combination.Intersect(T1,T2) is not equal to Intersect(T2,T1).
Thanks.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
23 | |
21 | |
20 | |
13 | |
12 |
User | Count |
---|---|
41 | |
31 | |
23 | |
23 | |
22 |