Forum Discussion
Anonymous
6 years agoNot applicable
Index depending on date, category and first case
Hi everybody, I'm still new in this and need help to index or rank my table. Here is the situation, I have a table with a date, country, and cases. I want to index/rank by date by country but...
- 6 years ago
Hi Anonymous
try this
Column = VAR __filterCountry = ALLEXCEPT( 'Table', 'Table'[Country] ) VAR __firstDate = CALCULATE( MIN( 'Table'[Date] ), __filterCountry, 'Table'[Cases] > 0 ) VAR __tbl = CALCULATETABLE( 'Table', __filterCountry, 'Table'[Date] >= __firstDate ) RETURN IF( 'Table'[Date] >= __firstDate, RANKX( __tbl, 'Table'[Date],, ASC, Dense ) )Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn
Mariusz
Community Champion
6 years agoHi Anonymous
try this
Column =
VAR __filterCountry = ALLEXCEPT( 'Table', 'Table'[Country] )
VAR __firstDate =
CALCULATE(
MIN( 'Table'[Date] ),
__filterCountry,
'Table'[Cases] > 0
)
VAR __tbl =
CALCULATETABLE(
'Table',
__filterCountry,
'Table'[Date] >= __firstDate
)
RETURN
IF(
'Table'[Date] >= __firstDate,
RANKX(
__tbl,
'Table'[Date],,
ASC,
Dense
)
)
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.