Forum Discussion
hasier
3 years agoFrequent Visitor
Using RANKX to order by date and more criterias
Hi, I am trying to order one table by date using RankX() but taking into account that when the value is the same on column "Name" the output should be the same and that I only want to order when ...
- 3 years ago
Hi,
Please check the below picture and the attached pbix file.
Rank CC = VAR _newtable = FILTER ( Data, Data[Task] = "PUBLISH" ) VAR _rankcolumn = SUMMARIZE ( ADDCOLUMNS ( _newtable, "@rank", COUNTROWS ( FILTER ( _newtable, Data[Date] <= EARLIER ( Data[Date] ) ) ) ), Data[Name], [@rank] ) RETURN MAXX ( FILTER ( _rankcolumn, Data[Name] = EARLIER ( Data[Name] ) ), [@rank] )
Jihwan_Kim
Super User
3 years agoHi,
Please check the below picture and the attached pbix file.
Rank CC =
VAR _newtable =
FILTER ( Data, Data[Task] = "PUBLISH" )
VAR _rankcolumn =
SUMMARIZE (
ADDCOLUMNS (
_newtable,
"@rank", COUNTROWS ( FILTER ( _newtable, Data[Date] <= EARLIER ( Data[Date] ) ) )
),
Data[Name],
[@rank]
)
RETURN
MAXX ( FILTER ( _rankcolumn, Data[Name] = EARLIER ( Data[Name] ) ), [@rank] )