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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Matching data in two unrelated tables for a SUM

Hi

 

I hope you can help!

 

I have three tables;

 

DISREPAIR DATA  is a list of properties where a claim has been raised because the property is in disrepair and it contains a property reference.

 

REPAIR FOLLOWING DISREPAIR is the other table is where a repair has been raised following a disrepair claim, it also contains a property reference.

 

PROPERTY DATA third table is the property table with a property reference.

 

DISREPAIR DATA and REPAIR FOLLOWING DISREPAIR are connected to PROPERTY DATA using one-to-many relationships.

 

I want to calculate the cost of REPAIR FOLLOWING DISREPAIR (there is a repair cost column) ensuring that only property references which appear in both DISREPAIR DATA and REPAIR FOLLOWING DISREPAIR are calculated.

 

How would I do this? I thought it would be either relatedtable or related function but I can't get it to work.

 

Thanks in advance! 

 

 

1 ACCEPTED SOLUTION

@Anonymous  you can try out a measure like this

Measure =
CALCULATE (
    SUM ( DisrepairFollowingRepair[RepairAmount] ),
    TREATAS (
        VALUES ( DisrepairData[Property Reference] ),
        DisrepairFollowingRepair[Property Reference]
    )
)
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi

 

I hope the below is ok!

 

So I want to work out the repair amount in the Disrepair Following Table but only if the property reference in Disrepair Following Repair appears in the Disrepair Data table @amitchandak 

 

Model in Excel.jpg

Anonymous
Not applicable

@smpa01 I owe you a pint plus I've learnt something knew too which I've been trying to learn, thank you!!!

@Anonymous  you can try out a measure like this

Measure =
CALCULATE (
    SUM ( DisrepairFollowingRepair[RepairAmount] ),
    TREATAS (
        VALUES ( DisrepairData[Property Reference] ),
        DisrepairFollowingRepair[Property Reference]
    )
)
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
amitchandak
Super User
Super User

@Anonymous ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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