Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

How to create an index

Hello, I would like to know how to create an index such index1 (see the example below) and that for each project in DAX (calculated column)     Project Fiscal Period TargetDate index1 A ...
  • camargos88's avatar
    camargos88
    6 years ago

    Hi Anonymous ,

     

    Try this code for a calculated column:

    Index = IF('Table'[Fiscal Period] >= 'Table'[TargetDate], RANKX(FILTER('Table', 'Table'[Project] = EARLIER('Table'[Project]) && 'Table'[Fiscal Period] >= 'Table'[TargetDate]), 'Table'[Fiscal Period],,ASC), BLANK())