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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
BobKoenen
Helper IV
Helper IV

Measure for Sum from 2 tables with added text column

Hi All,

 

I have Dim table [customer] and 2 fact tables which I cannot append or merge. 

Customerid
JoeA
JaneB
JosephC

Fact table 1

IdAmount
A500
B400
C100

Fact table 2

IdAmount
B1000

 

Now I want the measure to Sum the amount of [fact table 2] and (the amount of [fact table 1] Exept for the id`s that are present in the [fact table 2]). So Each id gets only included once. I also want a text for each row indicatin from which fact table the amount is taken. 

 

Result:

CustomerAmountOrigin
Joe50Fact table 1
Jane1000Fact table 2
Joseph100Fact table 1

 

Hope you can help me

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @BobKoenen

I think it would be best to do this in PQ but see the file attached for a possible solution through measures as requested

 

Amount_M = 
VAR fT2_ = SELECTEDVALUE(FTable2[Amount])
RETURN
IF(ISBLANK(fT2_), SELECTEDVALUE(FTable1[Amount]), fT2_)  

 

 

 

Origin_M = 
VAR fT2_ = SELECTEDVALUE(FTable2[Amount])
RETURN
IF(ISBLANK(fT2_), "FTable1", "FTable2")  

 

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

View solution in original post

1 REPLY 1
AlB
Community Champion
Community Champion

Hi @BobKoenen

I think it would be best to do this in PQ but see the file attached for a possible solution through measures as requested

 

Amount_M = 
VAR fT2_ = SELECTEDVALUE(FTable2[Amount])
RETURN
IF(ISBLANK(fT2_), SELECTEDVALUE(FTable1[Amount]), fT2_)  

 

 

 

Origin_M = 
VAR fT2_ = SELECTEDVALUE(FTable2[Amount])
RETURN
IF(ISBLANK(fT2_), "FTable1", "FTable2")  

 

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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