Forum Discussion
Murali777
Helper III
4 years agoFind minimum value between two rows
Hi, I need to find Min value between two rows by using calculated measure not a calculated column. Please find the screenshot below.
- 4 years ago
Murali777 I hope it helped, if yes, please mark the solution so that it can help others as well
Regards,
Ritesh
Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My You Tube Channel !! Connect on Linkedin
ribisht17
Super User
4 years ago
Step 1: Create an INDEX to your TABLE from the Transform tab
Step 2: Get the next name from Top to Bottom
Name +1 = CALCULATE(min(MinMaxGrp[Name]),FILTER(all(MinMaxGrp),MinMaxGrp[Index]=EARLIER(MinMaxGrp[Index])+1))
Step 3: Similarly Get the Next Value as well for the Name with the below calculation
Value +1 = CALCULATE(min(MinMaxGrp[Value]),FILTER(all(MinMaxGrp),MinMaxGrp[Index]=EARLIER(MinMaxGrp[Index])+1))
Step 4:
Value -1 = CALCULATE(min(MinMaxGrp[Value]),FILTER(all(MinMaxGrp),MinMaxGrp[Index]=EARLIER(MinMaxGrp[Index])-1))
Step 5: Get the Max out of Two
Max =
IF(MinMaxGrp[Name]="A", max(MinMaxGrp[Value],MinMaxGrp[Value +1]),max(MinMaxGrp[Value],MinMaxGrp[Value -1]))
Step 5:
Final Solution as (We will nullify the values against B and Will keep only one Value )
Solution Max = IF(MinMaxGrp[Name]=MinMaxGrp[Name +1],0, IF(MinMaxGrp[Value]=MinMaxGrp[Max],MinMaxGrp[Value],0))
NOTE: I did it for Max and you have to Use Min 🙂
Regards,
Ritesh
Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My You Tube Channel !! Connect on Linkedin