Forum Discussion
Rank if
- 7 years ago
Anonymous
As a calculated column..you can use
Column = RANKX ( FILTER ( Primary_ID, [Type] = EARLIER ( [Type] ) ), [Date], , ASC, DENSE )
Anonymous
Create a new Column and Measure and add the folowing DAX code:
Rank =
VAR d = Table[Date]
VAR a = Table[Type]
RETURN
CALCULATE (
RANK.EQ ( d, Table[Date], ASC ),
FILTER ( ALL ( 'Table' ), Table[Type] = a )
)Thanks.
I've tried this..
=CALCULATE(RANK.EQ(Primary_ID[Date],Primary_ID[Date],ASC),FILTER(all(Primary_ID),Primary_ID[Type]=Primary_ID[Type]))
But get the error..
A single value for column 'Date' in table 'Primary_ID' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
- Zubair_Muhammad7 years ago
Community Champion
Anonymous
As a calculated column..you can use
Column = RANKX ( FILTER ( Primary_ID, [Type] = EARLIER ( [Type] ) ), [Date], , ASC, DENSE )- Anonymous7 years agoNot applicable
Perfect! That's the answer thanks!
- themistoklis7 years ago
Community Champion
Anonymous
You have to declare the variables outside the DAX formula and then call them inside (as shown on the formula sent).
They are immutabe that's why i used them.
If you try it as shown, you will see it works this way