Forum Discussion

Charline_74's avatar
Charline_74
Icon for Resolver I rankResolver I
2 years ago
Solved

Having an index column in a visual table

Hi On my Power BI report, I have a visual table that fetches columns from several tables. And I'd like to create an index in this visual but I don't know how to do it? Does anyone have a solution?...
  • bhanu_gautam's avatar
    2 years ago

    Charline_74 , You can create a column or measure using RANKX function

     

    For calculated column

    Index = RANKX(ALL('Sales'), 'Sales'[OrderDate], , ASC, DENSE)

     

    For measure

    IndexMeasure =
    VAR CurrentRow = MAX('Sales'[OrderDate])
    RETURN
    RANKX(ALL('Sales'), 'Sales'[OrderDate], CurrentRow, ASC, DENSE)