Forum Discussion

Murali777's avatar
Murali777
Helper III
4 years ago
Solved

Find 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.

 

 

8 Replies

  • Murali777 

     

    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

     

    • Murali777's avatar
      Murali777
      Helper III

      Hi Ritesh,

       

      Need to find the Min values column results. we need to figure out the min value for the combination of Name (A and B ) values. remaining should be empty result set.

       

      Please help me on this scenario.

       

       

  • Hi Guys,

     

    Please anyone help me on this.

    I need to find the min values between two rows.


    • Murali777's avatar
      Murali777
      Helper III

      We need to consider only A and B combination rows and find min value for these combination, remaining should be empty.

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi Murali777 ,

     

    Whether the advice given by ribisht17  has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.


    Looking forward to your feedback.


    Best Regards,
    Henry