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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.