Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
data looks kind of like this
store product
a 1
b 2
c 1
a 1
a 2
b
c
b
I want to be able to retrieve the product mentioned most under a,b,c etc
Solved! Go to Solution.
I insteretd this data into a table
and this is the result I get
this si the DAX measure code
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your threadconsider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
INDEX function (DAX) - DAX | Microsoft Learn
product mentioned most: =
VAR _t =
ADDCOLUMNS (
SUMMARIZE ( data, store[store], 'product'[product] ),
"@count", CALCULATE ( COUNTROWS ( data ) )
)
VAR _index =
SUMMARIZE (
INDEX ( 1, _t, ORDERBY ( [@count], DESC ),, PARTITIONBY ( store[store] ) ),
store[store],
'product'[product]
)
VAR _list =
SUMMARIZE (
CALCULATETABLE ( data, TREATAS ( _index, store[store], 'product'[product] ) ),
store[store],
'product'[product]
)
RETURN
CONCATENATEX ( _list, 'product'[product], ", " )
Try this ...
Create some test data
Create a measure
Rank =
var cursor_store = SELECTEDVALUE(Facts[Store])
RETURN
RANKX(
FILTER(
ALL('Facts'),
'Facts'[Store] = cursor_store
),
CALCULATE(COUNTROWS(Facts)),
,
ASC
,
DENSE
)
Draw a table visual with FILTER in the FILTER PANE
Note that at store C noth Apples and Pears both had the top rank.
Please click thumbs up because I have tried to help.
Then click [accept solution] if it works.
Learn more about RANKX here ...
Hey @speedramps
try this , its short code
Try this ...
Create some test data
Create a measure
Rank =
var cursor_store = SELECTEDVALUE(Facts[Store])
RETURN
RANKX(
FILTER(
ALL('Facts'),
'Facts'[Store] = cursor_store
),
CALCULATE(COUNTROWS(Facts)),
,
ASC
,
DENSE
)
Draw a table visual with FILTER in the FILTER PANE
Note that at store C noth Apples and Pears both had the top rank.
Please click thumbs up because I have tried to help.
Then click [accept solution] if it works.
Learn more about RANKX here ...
Please read the traning materila I provided about RANX whichj explain how the Dense argument works.
Sometimes you find some products rank the same for a store.
For example Appes and Orageges may both rank 2nd place for a store.
The Dense help you deecide if you want to skip postion 3 and go to 4 for the next rank.
In your case it does not matter because you omly want the top rank.
Learn more about RANKX here ...
can't seem to get that working what does the DENSE bit at the end do ?
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
INDEX function (DAX) - DAX | Microsoft Learn
product mentioned most: =
VAR _t =
ADDCOLUMNS (
SUMMARIZE ( data, store[store], 'product'[product] ),
"@count", CALCULATE ( COUNTROWS ( data ) )
)
VAR _index =
SUMMARIZE (
INDEX ( 1, _t, ORDERBY ( [@count], DESC ),, PARTITIONBY ( store[store] ) ),
store[store],
'product'[product]
)
VAR _list =
SUMMARIZE (
CALCULATETABLE ( data, TREATAS ( _index, store[store], 'product'[product] ) ),
store[store],
'product'[product]
)
RETURN
CONCATENATEX ( _list, 'product'[product], ", " )
This is great thank you, can you tell me what i would add to count the results of the most popular/mentioned please ?
This is great thank you, can you tell me what i would add to count the results of the most popular/mentioned please ?
I insteretd this data into a table
and this is the result I get
this si the DAX measure code
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your threadconsider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 9 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 27 | |
| 22 | |
| 20 | |
| 18 | |
| 12 |