Forum Discussion

kkalyanrr's avatar
kkalyanrr
Icon for Helper V rankHelper V
4 years ago
Solved

Finding difference between Max and Min values in a group and share accordingly

Hello, I've a below scenario, where in I need to share a value with the group. The idea is to make all the values close to one another. In the below case I need to share 25 with the left group.....
  • v-luwang-msft's avatar
    4 years ago

    Hi  kkalyanrr ,

    It seems to me that based on the template you have provided so far, the figure you want to share is 26, not 25.26 is the sum of all the differences. 

    Refer the following measure:

    diff = var  value1=CALCULATE(MAX('Table'[Value]),ALL('Table')) -CALCULATE(MAX('Table'[Value]),filter(ALL('Table'),'Table'[Group]=MAX('Table'[Group])))  return value1
    maxdiff = MAXX('Table','Table'[diff])
    sumdiff = SUMX('Table','Table'[diff])

     

     

    Did I answer your question? Mark my post as a solution!


    Best Regards

    Lucien