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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Multiple use relationship statements in measure

Hi! I'm building a dashboard that will be showing high level management data on a weekly level.

I've got 3 dimension tables: Visits, DateDim & Moves.

 

I want to calculate the count of different move times during a visit, but I want to be able to filter the visits on date, using the datedim.

 

In a seperate table I am combing the visits with a calculated column per move type. Let assume that we have 2 moves: Discharge and Load. The type can be identified as Discharge when Move.Inbound_ID = Visit.ID. Load can be identifief when Move.Outbound_ID = Visit.ID.

 

To achieve this, in my opinion, I would like to use 2 'use relationship' functions. The following formule gives an error:

 

Discharge = CALCULATE(COUNT(Visits[ProductID]);USERELATIONSHIP(Moves[VisitID];Visits[id])
;USERELATIONSHIP(Vists[ATD_gkey];DateDim[DateTimeKey]))
 
I get the following error:
Join paths are expected to form a tree, but the table 'Throughput' has two join paths to table 'Visits': 'Moves'->'Visits' and 'Moves'->'Visits'.
 
2 REPLIES 2
parry2k
Super User
Super User

@Anonymous can you share relationship diagram, seems like you have un-necessary relationship going on



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Sure.

 

Capture.PNG

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!