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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
tc_WII
Frequent Visitor

USERELATIONSHIP Issue

Hello,

I have 2 tables.

ID Table:

IDPriceParent
A

25

 
B29A
C30A
D41 
E42D
F43D

 

shippingTable:

IDShipping
A3
D5

 

For B,C,E,F value, i don't have any shipping. I have parent column for those to fetch shipping.

 

my ID table is connected to shipping table on ID-ID 1on1 relationship. 2nd inactive relationship is Parent-ID that is many to one.

 

I used below measure to fetch shipping based on parent:

shipCost=
CALCULATE(MAX(tbShipping[Shipping]),
USERELATIONSHIP(tbShipping[ID],tbID[Parent]),CROSSFILTER(tbShipping[ID],tbID[Parent],Both))
 
But its not working. what might be the issue?
tc_WII_0-1692288654646.png

I can achieve this with a calculated column on table. But I want to figure out what is the issue  with measures

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @tc_WII ,

 

I suggest you to try code as below to create a measure.

shipCost =
VAR _VALUE1 =
    CALCULATE ( MAX ( tbShipping[Shipping] ) )
RETURN
    IF (
        ISBLANK ( _VALUE1 ),
        CALCULATE (
            MAX ( tbShipping[Shipping] ),
            FILTER ( ALL ( tbShipping ), tbShipping[ID] = MAX ( tbID[Parent] ) )
        ),
        _VALUE1
    )

Result is as below.

vrzhoumsft_0-1692604825380.png

Best Regards,
Rico Zhou

 

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

4 REPLIES 4
amitchandak
Super User
Super User

@tc_WII , Try like

 

shipCost=
CALCULATE(MAX(tbShipping[Shipping]),
USERELATIONSHIP(tbShipping[ID],tbID[Parent]))

 

Worked for me, file is attached after signature

 

amitchandak_0-1692322744645.png

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I used the same measure, but it did not work in my model. The only difference on your data model is, both of your relationship is one-to-many. but i used id-id as one to one, only because tbID[ID] is also unique value. Because of that one-to-one, my measure is not grabbing the result 😞

 

tc_WII_0-1692368673151.png

 

Anonymous
Not applicable

Hi @tc_WII ,

 

I suggest you to try code as below to create a measure.

shipCost =
VAR _VALUE1 =
    CALCULATE ( MAX ( tbShipping[Shipping] ) )
RETURN
    IF (
        ISBLANK ( _VALUE1 ),
        CALCULATE (
            MAX ( tbShipping[Shipping] ),
            FILTER ( ALL ( tbShipping ), tbShipping[ID] = MAX ( tbID[Parent] ) )
        ),
        _VALUE1
    )

Result is as below.

vrzhoumsft_0-1692604825380.png

Best Regards,
Rico Zhou

 

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

This worked. Thank you 🙂

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.