Forum Discussion
DAX formula help
- 7 years ago
Try something along the lines of:
checkvalue = VAR __npi = MAX([NPI]) VAR __table = SUMMARIZE(FILTER(ALL('Table'),[NPI]=__npi),[Service],"__count",COUNT([PlanID])) VAR __highest = MAXX(__table,[__count]) RETURN __highest
Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Hi Greg,
Thanks for your reply. Can you please let me know which topic have i violated? You had sent this to me in another post where I had not provided sample data and/or the work I had attempted. I had been careful since then, since I believe in keeping the communication cleaner.
I fail to understand what is missing this time around? I have provided sample data, scenario and expected output. Unfortunately this blog does not allow me to attach power bi file (which I had raised initially but could not get around it).
Thanks.
- Greg_Deckler7 years agoCommunity Champion
There's no violation, this isn't the Power BI police, I'm just not seeing the sample source data. Did I miss that in the original post? It looked like the data you posted was your results? Sample data is always helpful.
- ppgandhi117 years agoHelper V
Sample Data:
NPI PlanID Service
1 PlanA A
1 PlanB A
1 PlanA B
1 PlanB B
1 PlanC B
1 PlanD B
1 PlanE B
1 PlanA C
1 PlanB C
1 PlanC C
1 PlanD C
2 PlanK A
2 PlanM B
2 PlanL B
Expected output:for NPI 1 via drillthrough: I am able to get to NPI 1 page.
Service Count
A 5
B 5
C 5
- Greg_Deckler7 years agoCommunity Champion
Try something along the lines of:
checkvalue = VAR __npi = MAX([NPI]) VAR __table = SUMMARIZE(FILTER(ALL('Table'),[NPI]=__npi),[Service],"__count",COUNT([PlanID])) VAR __highest = MAXX(__table,[__count]) RETURN __highest