Forum Discussion

sivarajan21's avatar
sivarajan21
Icon for Post Prodigy rankPost Prodigy
3 years ago
Solved

find max and min value from same column obtained from dynamic slicer selection and find difference

Dear all,

 

I need to create a dax for dynamically selecting sites from the slicer and find the difference from max & min selected.

For example, in above screenshot, I have selected 3 sites, out of which max is 316.46 and min is 31.55. so I need a measure

to return the difference and calculate the performance % 

dax measure diff = 316.46 - 31.55 

performance measure = dax measure diff/max(dax measure diff)

 

Could you please guide me on this?

 

Regards,

SC

  • Here is a sample of the pseudo code:

     

    performance measure = divide(maxx(table,units)-minx(table,units),maxx(allselected(table),units)-minx(allselected(table),units))

     

    you can refine that with SUMMARIZE(ALLSELECTED())  etc.  Really depends on how you want to interpret it.

  • lbendlin's avatar
    lbendlin
    3 years ago
    performance measure = 
    var mmax = CALCULATE(max(DataProfile[Units]),allselected(Contacts[Name]))
    var mmin = CALCULATE(min(DataProfile[Units]),allselected(Contacts[Name]))
    return mmax-mmin

15 Replies