Forum Discussion
Meg_01
1 year agoNew Member
Dax
Need help How can get I top products bought by each gender in a bar chart using no or simplest dax when I do top products by female and male using filter I get correct output but together in bar c...
bhanu_gautam
Super User
1 year agoRank the products by gender:
ProductRankByGender =
RANKX(
FILTER(
ALL('Sales'),
'Sales'[Gender] = EARLIER('Sales'[Gender])
),
CALCULATE(SUM('Sales'[Quantity])),
,
DESC
Filter the top products:
TopProductsByGender =
CALCULATETABLE(
'Sales',
'Sales'[ProductRankByGender] <= 5
)
For more share sample data