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...
bo_afk
5 years agoPost Patron
Hi camargos88, thanks for your response.
I did try to filter the visual but it didnt work for me. What formula did you use for Rank?
I used the following:
Rank = RANKX(ALL(Table[Channel]),[Total visits])
where [Total visits] is a measure sum(visits)
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])