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
sheetals
Helper I
Helper I

Showing unexpected values in Power BI charts

Please find my expected result below

pbi3.PNG

But I am getting result as below

pbi4.PNG

where I have choosed Order Id from orders table and Product Id from Order Items tables and I have used below measure 

order_to_orderitem = CALCULATE(SUM('Order Items'[Unit Price]),USERELATIONSHIP(orders[key12],'Order Items'[key12]))
 
Note: key12 is merged column of Order Id and Product Id in both orders and Order Items table
 

I have a datamodel as shown below

pbi5.png

I have given a relationship as shown blow

pbi6.PNG

It has been created as shown below where From Table is Order Items and To Table is orders whereas while creating I have given orders as From Table and Order Items as To Table

pbi7.PNG

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @sheetals 

 

You can try the following methods.

order_to_orderitem = 
IF (
    MAX ( 'orders'[Product ID] ) == BLANK (),
    BLANK (),
    CALCULATE (
        SUM ( 'Order Items'[Unit Price] ),
        USERELATIONSHIP ( orders[key12], 'Order Items'[key12] )
    )
)

vzhangti_0-1638760552167.png

If the method I provided above can't solve your problem, what's your expected result? Could you please provide more details for it?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-zhangti
Community Support
Community Support

Hi, @sheetals 

 

You can try the following methods.

order_to_orderitem = 
IF (
    MAX ( 'orders'[Product ID] ) == BLANK (),
    BLANK (),
    CALCULATE (
        SUM ( 'Order Items'[Unit Price] ),
        USERELATIONSHIP ( orders[key12], 'Order Items'[key12] )
    )
)

vzhangti_0-1638760552167.png

If the method I provided above can't solve your problem, what's your expected result? Could you please provide more details for it?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.