Forum Discussion

d904490's avatar
d904490
Frequent Visitor
7 years ago
Solved

select the top values!

trying to select only the values which are 12 less than 160. example- name = 160, output = 160; otherwise take name whaich are less than or equal to ()160-12. I also have another table which returns this current target value i.e. 160 or the changed value if changes in future. so I try to pick the name values which are 12 less than my target. I am new to power bi, need urgent help, please.

  • Hi,@d904490 

        you can use this formula to add a column as like below:

    Top5 = IF(CALCULATE(MAX(Table3[current match number]))-Table2[match_number]<=5,"Top 5")

    basic data

     

    table1

     

    table2

    Then you can filter the column Top5

     

    Best Regards,

    Lin

4 Replies

  • v-lili6-msft's avatar
    v-lili6-msft
    Community Support

    hi,@d904490 

        Your description is not clear, Please show us your desired result in the data sample? you can provide some data sample and the expected output or the pbix .You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading. 

     

    Best Regards,

    Lin

     

     

    • d904490's avatar
      d904490
      Frequent Visitor

      please find the sample data and the desired output attached below.

      Table 1:return the current match number. Example the current match number is 160 and next week  it will change to 161 and every week it changes to 1+
      table 2:id, enddate, startdate, match number         
      idendatestart datematch_number         
      129/06/201825/06/2018151          
      26/07/20182/07/2018152          
      313/07/20189/07/2018153          
      420/07/201816/07/2018154          
      527/07/201823/07/2018155          
      63/08/201830/07/2018156          
      710/08/20186/07/2018157          
      817/08/201813/07/2017158          
      924/08/201820/07/2018159          
      1031/08/201827/072018160          
                    
      Output:top 5 match_number <= current_match. i.e. only top 5 match_number <=160         
      527/07/201823/07/2018155          
      63/08/201830/07/2018156          
      710/08/20186/07/2018157          
      817/08/201813/07/2017158          
      924/08/201820/07/2018159          
      1031/08/201827/072018160          
                    
                    
                    
  • v-lili6-msft's avatar
    v-lili6-msft
    Community Support

    Hi,@d904490 

        you can use this formula to add a column as like below:

    Top5 = IF(CALCULATE(MAX(Table3[current match number]))-Table2[match_number]<=5,"Top 5")

    basic data

     

    table1

     

    table2

    Then you can filter the column Top5

     

    Best Regards,

    Lin