Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Add a Calculated index column using DAX

Hello All,

 

How can we create a index calculated column or measure using DAX, like we do in power query.

 

 

Any help.

 

Mohan V

 

  • Hi Anonymous,

    What does your data source look like? I create the following sample table and get expected result.

    sample table
    I create measure using the formula below.

    Index = RANKX(ALL(Test),FIRSTNONBLANK(Test[Project ID],Test[Project ID]),,ASC,Dense)


    Then create a table, select the Project ID and measure as the value level, you will get expected result as follows.



    Best Regards,
    Angelia

9 Replies

  • Hi Anonymous,

     

    have you tried to use the RANKX() function. This calculates a ranking depending on a value. So you should be able to generate an index column with it.

     

    Greetings

     

    spuder

    • Anonymous's avatar
      Anonymous
      Not applicable

      I tried spuder... but could find the solution.

       

      Any hint that how can i achieve it.

      • spuder's avatar
        spuder
        Resolver IV

        Anonymouswhat is the sort order of your table and does it has duplicate values in the sorted columns?