Forum Discussion

MrLanla's avatar
MrLanla
New Member
5 years ago
Solved

input data range condition with another table

hi , i want to make "new column" in power bi Desktop with related to another table with range condition 

 

first i have releatioship them and what next?

for example

i have two table

1. 

 

 

 

 

and 2. 

 

 

and this is the result i want ( in Table1)

 

 

what can i do with "new column"?  thank you 😀😉😥

 

 

 

 

 

  • MrLanla 

    you can try this

    Grade = 
    
    VAR _order=MINX(FILTER(Gradegroup,Gradegroup[Order]>'Table'[order]),Gradegroup[Order])
    return maxx(FILTER('Gradegroup',Gradegroup[Order]=_order),Gradegroup[Grade])

    pls see the attachment below

2 Replies

  • MrLanla 

    you can try this

    Grade = 
    
    VAR _order=MINX(FILTER(Gradegroup,Gradegroup[Order]>'Table'[order]),Gradegroup[Order])
    return maxx(FILTER('Gradegroup',Gradegroup[Order]=_order),Gradegroup[Grade])

    pls see the attachment below

    • MrLanla's avatar
      MrLanla
      New Member
      Grade = VAR _order=MINX(FILTER(Gradegroup,Gradegroup[Order]>'Table1'[Order Quantity]),Gradegroup[Order])
      return maxx(FILTER('Gradegroup',Gradegroup[Order]=_order),Gradegroup[Grade])
       
      Wow! 😮 this is work! i never use Variable in DAX before.
      i will try to understand, thanks for help.