Forum Discussion
EpicTriffid
4 years agoHelper IV
Dynamic index in custom order
Hi all, Bit of an interesting one. I have a table below, with a range of years, but I need an index in the order shown below: Year Index 2016 7 2017 6 2018 5 2019 4 ...
- Anonymous4 years ago
EpicTriffid , you can create a Calculated Column with this DAX formula below. I have named the table YearIndex in my example.
Index = IF( 'YearIndex'[Year] <= YEAR(now()), YEAR(now()) - 'YearIndex'[Year] + 1 ,'YearIndex'[Year] - YEAR(now()) + YEAR(now()) - MIN('YearIndex'[Year]) + 1 )
Anonymous
4 years agoNot applicable
EpicTriffid , you can create a Calculated Column with this DAX formula below. I have named the table YearIndex in my example.
Index =
IF(
'YearIndex'[Year] <= YEAR(now()), YEAR(now()) - 'YearIndex'[Year] + 1
,'YearIndex'[Year] - YEAR(now()) + YEAR(now()) - MIN('YearIndex'[Year]) + 1
)
EpicTriffid
4 years agoHelper IV
Just an absolute legend! So simple!