Forum Discussion
Power BI Dax - Merging 2 Data Tables With IF Condition
- 3 years ago
Hi,
If I understand well your model you have a 3rd table - I'll call it Table3 - that, as a dimension, has an M:1 relationship with Table1 and Table2, like in the figure:In this case, try something like this:
Spend Or Resubmission =SUMX(VALUES( Table3[Supplier Name] ),VAR _Spend = CALCULATE( SUM( Table1[Spend]) )VAR _SpenResubmission = CALCULATE( SUM( Table2[Spend] ) )RETURNCOALESCE( _SpenResubmission, _Spend ))and you will get this:
Hi,
If I understand well your model you have a 3rd table - I'll call it Table3 - that, as a dimension, has an M:1 relationship with Table1 and Table2, like in the figure:
In this case, try something like this:
Oh my word!! That is exactly what I have been trying to do. I was about to create a sample PBIX to separate the 3 tables. Thank you so very much 🙂
Could you please explain what COALESCE does in this instance? Thanks 🙂
- jmlesteves3 years agoFrequent Visitor
Hi,
DAX Guide has the perfect explanation and examples of the COALESCE function(and for all other DAX functions as well):
https://dax.guide/coalesce/
Regards- Xavianna3 years ago
Helper I
Thank you so much 🙂