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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.