Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi Team,
I have two table and created relationship both ID's and trying DAX if statement , can you help me.
formula is = if (table 1 .ID=Table 2.ID ,(A/C)*(G*B),null)

Thanks,
KV's
Solved! Go to Solution.
Hi @Anonymous ,
According to your description, you could create new table and measure then change ralationship, the following formula to create a measure and table :
step 1: Add table(newTable)
NewTable =
var _Table1=SELECTCOLUMNS('Table1',"ID",[ID])
var _Table2=SELECTCOLUMNS('Table2',"ID",[ID])
return DISTINCT UNION(_Table1,_Table2)
step2:Add measure(The null returned by this measure is text format. If you want to change to number format, change "null" to blank() )
value =
VAR _a =
DIVIDE ( MAX ( 'Table1'[A] ), MAX ( 'Table1'[C] ) ) * SUM ( Table2[G] )
* SUM ( Table1[B] )
RETURN
IF ( MAX ( 'Table1'[ID] ) = MAX ( 'Table2'[ID] ), _a, "null" )
Step3:Change relationship
The final output is shown below:
Best Regards,
Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
According to your description, you could create new table and measure then change ralationship, the following formula to create a measure and table :
step 1: Add table(newTable)
NewTable =
var _Table1=SELECTCOLUMNS('Table1',"ID",[ID])
var _Table2=SELECTCOLUMNS('Table2',"ID",[ID])
return DISTINCT UNION(_Table1,_Table2)
step2:Add measure(The null returned by this measure is text format. If you want to change to number format, change "null" to blank() )
value =
VAR _a =
DIVIDE ( MAX ( 'Table1'[A] ), MAX ( 'Table1'[C] ) ) * SUM ( Table2[G] )
* SUM ( Table1[B] )
RETURN
IF ( MAX ( 'Table1'[ID] ) = MAX ( 'Table2'[ID] ), _a, "null" )
Step3:Change relationship
The final output is shown below:
Best Regards,
Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!