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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
eliasayyy
Super User
Super User

match table A with table B according to common relation with table C

hello everyone i have 3 tables:

client names :

Account Name        Client Name
Account 1Name A
Account 2Name A
Account 3Name B
Account 4Name C
Account 5 Name D


revenue table:

Client Name        Total
Name Avalue
Name Avalue
Name Cvalue
Name Cvalue



payemnt table:

Account Name        Amount
Account 1value
Account 1value
Account 2value
Account 4value
Account 5value



i have 2 inactive relationships due to many to many and circular dependency errors

first relation is between client table(client name) and revenenue(client name)
second relation is between client table(account name) and payment(account name)

so how can i create a measure that match that account name from payment with client name from revenue table

expected result:

Client Name         Amount
Client Asum of value from account 1 + account 2
Client Csum of value from account 4




2 ACCEPTED SOLUTIONS
eliasayy
Impactful Individual
Impactful Individual

hello @eliasayyy 
please try:

Measure = 
CALCULATE(SUM(Payments[Amount]),
USERELATIONSHIP('Revenues'[Client Name],Clients[Client Name]),
USERELATIONSHIP(Clients[Account Name],Payments[AccountName]),
'Revenues'[Client Name] IN VALUES(Clients[Client Name]))

 

then add to table Client[Client Name]
and add the measure it should work

View solution in original post

RevenueTotal = Calculate(Sum(payment[Amount]), USERELATIONSHIP('client names'[Client Name], revenue[Client Name        ]), USERELATIONSHIP('client names'[Account Name        ], payment[Account Name        ]))
olgad_0-1673567424827.png

 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

View solution in original post

5 REPLIES 5
eliasayyy
Super User
Super User

thank you @eliasayy  and @olgad 

eliasayy
Impactful Individual
Impactful Individual

hello @eliasayyy 
please try:

Measure = 
CALCULATE(SUM(Payments[Amount]),
USERELATIONSHIP('Revenues'[Client Name],Clients[Client Name]),
USERELATIONSHIP(Clients[Account Name],Payments[AccountName]),
'Revenues'[Client Name] IN VALUES(Clients[Client Name]))

 

then add to table Client[Client Name]
and add the measure it should work

olgad
Super User
Super User

Hi there,

create inactive relationships

olgad_2-1673558094204.png

Then use USERELATIONSHIP in your calculation:

Payment Amount = Calculate(Sum(payment[Amount]), USERELATIONSHIP('client names'[Account Name], payment[Account Name]))

 

 

olgad_1-1673558050909.png

Hope that helps.

 

 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

hello @olgad  as you can see in revenue table there is no Client D only A and C 
i tried

Measure =  Calculate(Sum(payment[Amount]), 
USERELATIONSHIP('client names'[Account Name], payment[Account Name]),
Revenue[Client Name] IN VALUES(client names[Client Name])
)

RevenueTotal = Calculate(Sum(payment[Amount]), USERELATIONSHIP('client names'[Client Name], revenue[Client Name        ]), USERELATIONSHIP('client names'[Account Name        ], payment[Account Name        ]))
olgad_0-1673567424827.png

 


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors