Forum Discussion
yewling1201
4 years agoFrequent Visitor
Get the Popular Favourite Meal Type
Hi,
How do I calculate the count the Customers to get the top popular Meal Type?
Thank you!
Popular Meal = CONCATENATEX ( TOPN ( 1, ADDCOLUMNS ( VALUES ( 'Table'[Meal Type] ), "@Customers", CALCULATE ( COUNTROWS ( 'Table' ) ) ), [@Customers] ), [Meal Type], ", " )
In case you have ties in the 1st rank it will show them seperated with ", "
Hope that helps
2 Replies
- SpartaBI
Community Champion
Popular Meal = CONCATENATEX ( TOPN ( 1, ADDCOLUMNS ( VALUES ( 'Table'[Meal Type] ), "@Customers", CALCULATE ( COUNTROWS ( 'Table' ) ) ), [@Customers] ), [Meal Type], ", " )
In case you have ties in the 1st rank it will show them seperated with ", "
Hope that helps - Ashish_Mathur
Super User
Hi,
Write these measures
Customer count = countrows(Table)
Measure = CONCATENATEX(TOPN(1,Data,[Customer count]),Data[Meal Type],", ")