Forum Discussion
kkalyanrr
Helper V
4 years agoFinding 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.....
- 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 value1maxdiff = MAXX('Table','Table'[diff])sumdiff = SUMX('Table','Table'[diff])Did I answer your question? Mark my post as a solution!
Best RegardsLucien
amrans
4 years agoFrequent Visitor
I have showcased my working in both cases when you want to compare with maximum value in table or maximum value in selection. Few measures were developed to get desired result.
List of Measures are below
Current Row Value = MAX(SampleTable[Values])
Max All Values = MAXX(All(SampleTable),SampleTable[Values])
Difference All Max = SampleTable[Max All Values]-[Current Row Value]
Max All Selected Values = MAXX(ALLSELECTED(SampleTable),SampleTable[Values])
Difference All Selected Max = SampleTable[Max All Selected Values]-[Current Row Value]