Forum Discussion

arif_tsrm's avatar
arif_tsrm
Helper I
2 years ago
Solved

Dynamic N-Value (TOPN) for Least Popular Day Calculation

  I am trying to calculate Least popular day using the following DAX, but I am getting the fixed result ( Friday ) although there is no value ( blank) in friday, I think the result is fixed Friday i...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi arif_tsrm ,

    I do some changes on my DAX codes.

    Measure 2 = 
    VAR _A =
        MINX (
            FILTER ( 'Table', NOT ( ISBLANK ( 'Table'[Attendance] ) ) ),
            'Table'[Attendance]
        )
    RETURN
        LOOKUPVALUE ( 'Table'[DayShort], 'Table'[Attendance], _A )

    Then you can see that it will return you the smallest value other than blank.

     

     

     

    Best Regards

    Yilong Zhou

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.