Forum Discussion
bo_afk
5 years agoPost Patron
Using rank as filter
Hi, I have a table below which shows the number of visits to a web site for each customer based on the channel. I've also created a measure to rank the channel for each customer (using RANKX). What...
camargos88
5 years agoCommunity Champion
bo_afk ,
Use this measure, so you don't need to filter the visual:
_Rank Channel =
VAR _tbl = SUMMARIZE('Table', 'Table'[Channel], 'Table'[Customer], "Rank", RANKX(FILTER(ALL('Table'), 'Table'[Customer] = EARLIER('Table'[Customer])), CALCULATE(SUM('Table'[Total visits])),, DESC))
RETURN COUNTX(FILTER(_tbl, [Rank] = 1), [_Rank])
bo_afk
5 years agoPost Patron
Thanks camargos88 for your suggestion!
I have another column in my data, "device type", so it's possible for channel to appear on multiple rows for each customer if they browse on several devices. How do I amend the formula to take this column into account?
- camargos885 years agoCommunity Champion
- bo_afk5 years agoPost Patron
Hi camargos88 ,
Eventually I want to show this in a stacked column chart with customer counts as the value and 'channel' as the legend.
- camargos885 years agoCommunity Champion
bo_afk ,
So what role the column "device type" would play here ?
Just trying to understand to think about the measure.