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
Hadill
Helper I
Helper I

New Condition Column - Sum

Hello Friends 

 

I need some help here !

 

let's say I have 'Table1', and 'Tabel2'. the two tables have the same column [A] with the same content.

 

How can I write the folloing in DAX?

 

I want to add a new column [B] to 'Table1', which is the sum of 'Table2'[X] when the two columns [A] is equal on both tables?

 

appreciate your help.

1 ACCEPTED SOLUTION

This assumes there is a unique X value per A value.

 

You can avoid this summing X instead.

B = CALCULATE ( SUM ( Table2[X] ), Table2[A] = EARLIER ( Table1[A] ) )

View solution in original post

2 REPLIES 2
Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi,

Firstly bring the Column X for Table 2 in your Table 1 by LOOKUPVALUE:

 

Create a new column in your Table 1:

X= LOOKUPVALUE(Table2[x], Table2[A], Table1[1])

Mark this as a solution if I answered your question.Kudos are always appreciated.

Thanks

 

This assumes there is a unique X value per A value.

 

You can avoid this summing X instead.

B = CALCULATE ( SUM ( Table2[X] ), Table2[A] = EARLIER ( Table1[A] ) )

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.