Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago

Add Number to a Column

Hi all!!

I need to create this table



The table is ranked for the value of the right that it is calculated.

What I need is to add a simple column adding numbers per row in order, the hig value has 1 and so on.

Any idea? I think is kind of ranking (rank) but really is more simple because the rank is given for the right column

Regards

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Dear Juampe,

     

    Use the below DAX Expression in the calculated column. Table1 is the Table Name and Index is the column name where you have row number.

     

    = CALCULATE ( COUNT ( Table1[Index] ), FILTER ( ALLSELECTED ( Table1 ), Table1[Index] <= MAX ( Table1[Index] ) ) )

     

    Hope this information helps a lot.

     

    Regards,

    Pradeep 

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the response but didn´t work

      • Anonymous's avatar
        Anonymous
        Not applicable

        Dear Juampe,

         

        I will provide you the simplest way to do this.

         

        1. Go to your dataset and click on the ellipses (...) and select edit query. 

        2. Then, go to Add column Menu on the top and select "Custom" value from Index Column option.

        3. Enter starting Index is 1 and Increment is 1. Click on OK. 

        4. Go to Home Menu and Click on Close & Apply option 

        5. You are set to go. The above steps will create an index column in your Dataset and you are good to go.

         

        Regards,

        Pradeep