Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi again - I think I defined my requirements incorrectly.
Input:
Flavors-Sold-Data-Table
| Location | Flavor |
| A | Vanilla |
| B | Strawberry |
| B | Vanilla |
| A | Strawberry |
| B | Strawberry |
| B | Vanilla |
| B | Chocolate |
| A | Vanilla |
| A | Chocolate |
| A | Chocolate |
I would like show the location with the maximum count of flavor if the flavor is either Vanilla or Strawberry.
The output in the Measure I am looking for would be "B" since B has the highest count of the flavor Vanilla and Strawberry (4).
Any thoughts?
Solved! Go to Solution.
Var tbl =
Addcolumns(
All(Table),
"@cnt",
Calculate(
Countrows( table ),
Table[flavor] in {"vanilla", "strawberry"}
)
)
Return
Max(
Topn( 1, tbl, [@cnt], desc),
[@cnt]
)
Not sure about the button part
HI - This is working - thank you.
Question - what if I want to have a seperate measure showing the number (in this case 4).
Also, how can I set up image button (like click here for more details) that will go to another page of the table data and only show those four records ?
max count =
var a = SUMMARIZE(filter('Table',[Flavor] in {"Vanilla","Strawberry"}),[Location],"ct",COUNTROWS('Table'))
return MAXX(a,[ct])
The button would have to be tied to a sort of filter (bookmark) to be efficient. Otherwise you could just add a static table, and you would need to define what you mean by "more details"
Var tbl =
Addcolumns(
All(Table),
"@cnt",
Calculate(
Countrows( table ),
Table[flavor] in {"vanilla", "strawberry"}
)
)
Return
Max(
Topn( 1, tbl, [@cnt], desc),
[@cnt]
)
Not sure about the button part
Var tbl =
Addcolumns(
All(Table),
"@cnt",
Calculate(
Countrows( table ),
Table[flavor] in {"vanilla", "strawberry"}
)
)
Return
Max(
Topn( 1, tbl, [@cnt], desc),
Table[location]
)
max count location =
var a = SUMMARIZE(filter('Table',[Flavor] in {"Vanilla","Strawberry"}),[Location],"ct",COUNTROWS('Table'))
return CONCATENATEX(TOPN(1,a,[ct]),[Location])
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 50 | |
| 18 | |
| 11 | |
| 11 | |
| 10 |