Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

How do I use RANK() to rank date

Hi,    I am new to PowerBI!   What I have is the EQP_ID & FCST_TIME, and I would like to add a column  called "Rank' to display the FCST_OUT_TIME ranking by Measure Function The earliest FCST_OU...
  • Irwan's avatar
    2 years ago

    hello Anonymous 

     

    please check if this accomodate your need.

     

    create new calculated column with following DAX:

    Rank =
    var _Rank =
    RANKX(
        FILTER(
            'Table',
            'Table'[FCST_OUT_TIME]
        ),
        'Table'[FCST_OUT_TIME],
        ,ASC
    )
    Return
    IF(
        ISBLANK('Table'[FCST_OUT_TIME]),
        0,
        _Rank
    )

     

    Hope this will help you.

    Thank you.