Forum Discussion

Kishorb's avatar
Kishorb
Frequent Visitor
7 years ago
Solved

DAX

HI , I  need a help  in correcting measure defination which was display 'second lowest value' into a table but when i used this measure into Card visual then blank() value displayed.  I have created...
  • v-yuta-msft's avatar
    v-yuta-msft
    7 years ago

    Kishorb,

     

    Use calculate column instead of measure to achieve the rank:

    MRank2 = 
    RANKX (
        FILTER (
            'Sales Data', 'Sales Data'[Dep] = EARLIER('Sales Data'[Dep])
        ),
        RANKX ( ALL ( 'Sales Data' ), 'Sales Data'[Target],, DESC, Dense)
    )

    Then modify the measure like below:

    Second lowest Quota = 
    VAR lowest_count = COUNTROWS(FILTER('Sales Data', 'Sales Data'[MRank2] = 1))
    RETURN
    CALCULATE(MAX('Sales Data'[Target]), FILTER(ALL('Sales Data'), 'Sales Data'[MRank2] = lowest_count + 1))

      

     

    Community Support Team _ Jimmy Tao

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