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,...
  • lbendlin's avatar
    3 years ago

    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