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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.