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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello Community,
I need to make a comparison between two columns, "Week Planned Out" and "Week Out" that come from two different queries.
When I try to do the IF formula and compare whether the "Week Planned Out" is greater than "Week Out", I cannot select columns from other different queries
How can I do this?
Thanks in advance for your help!
Solved! Go to Solution.
Hi @ss89 ,
Please try below steps:
1. below is my test table
Table:
Table2
Table3:
Table4:
Model:
2. try below dax formula
has relationship:
Column = IF([Sale]>RELATED('Table'[Cost]),"+","-")
no relationship:
Column =
VAR cost =
LOOKUPVALUE ( 'Table 3'[Cost], 'Table 3'[Product], 'Table 4'[Product] )
RETURN
IF ( [Sale] > cost, "+", "-" )
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ss89 ,
Please try below steps:
1. below is my test table
Table:
Table2
Table3:
Table4:
Model:
2. try below dax formula
has relationship:
Column = IF([Sale]>RELATED('Table'[Cost]),"+","-")
no relationship:
Column =
VAR cost =
LOOKUPVALUE ( 'Table 3'[Cost], 'Table 3'[Product], 'Table 4'[Product] )
RETURN
IF ( [Sale] > cost, "+", "-" )
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Do you try the solution define here : https://www.spguides.com/power-bi-compares-two-columns-in-different-tables/ ?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 64 | |
| 44 | |
| 42 | |
| 34 | |
| 23 |
| User | Count |
|---|---|
| 199 | |
| 124 | |
| 104 | |
| 74 | |
| 55 |