Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
bobert523
Regular Visitor

Combine queries with conditions

I have two tables - one with order data and one with pricing data.  I want to combine the pricing data query to the order data so I can pull in the new price against historical order data.

 

Order Data-

Cust #

Loc #

Item #

Order Qty

 

Price Data-

Cust #

Loc #

Item #

Order minimum for price (same UOM as Order Qty in Order Data), but would use a <= 

Price per unit

 

Having an issue pulling in the correct price based on quantity.

2 REPLIES 2
amitchandak
Super User
Super User

@bobert523 , Create a new column in dax like

 

new column =
maxx(filter(price, price[Cust #] = order[Cust #] && price[Loc #] = order[Loc #]&& price[Item #] = order[Item #] && Price[Order minimum for price] <= Order[Order Qty]),Price[Order minimum for price] )
return
maxx(filter(price, price[Cust #] = order[Cust #] && price[Loc #] = order[Loc #]&& price[Item #] = order[Item #] && Price[Order minimum for price] = _max),Price[Price per unit] )

Hello- thank you for your suggestion.  I tried that, but get "Token Literal expected" on the Pricing[Loc#] step.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.