Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
I have a problem about joining two tables with OR condition.
Please help.
Eg.
Table : Campaign
field : CampaignID, CampaignName
Table : Register
field : RegisterID, CustomerID, RegisterDate, RegisterCampaignID, MediaCampaignID
I have Campaign as a Slicer on Power BI report.
and I want to retrieve Register data by selected Campaign
with condition likes this :
Campaign A inner join Register B
on (A.CampaignID = B.CampaignID
OR A.CampaignID = B.MediaCampaignID)
Please help me, is there any way to do this on report?
Thank you.
Solved! Go to Solution.
Hi @payom,
Usually, we don't need to join tables. But you still can do it in these ways.
1. Join in the Query Editor. Pleas download this demo for details: https://1drv.ms/u/s!ArTqPk2pu-BkgUr3Z6TK1Q_VI9S-
2. By DAX.
2.1 Create two relationships.
2. 2 Use this formula to create a new calculated table.
Table = UNION ( NATURALINNERJOIN ( 'Campaign', 'Register' ), CALCULATETABLE ( NATURALINNERJOIN ( 'Campaign', Register ), USERELATIONSHIP ( Campaign[CampaignID], Register[ MediaCampaignID] ) ) )
Best Regards!
Dale
Hi @payom,
Usually, we don't need to join tables. But you still can do it in these ways.
1. Join in the Query Editor. Pleas download this demo for details: https://1drv.ms/u/s!ArTqPk2pu-BkgUr3Z6TK1Q_VI9S-
2. By DAX.
2.1 Create two relationships.
2. 2 Use this formula to create a new calculated table.
Table = UNION ( NATURALINNERJOIN ( 'Campaign', 'Register' ), CALCULATETABLE ( NATURALINNERJOIN ( 'Campaign', Register ), USERELATIONSHIP ( Campaign[CampaignID], Register[ MediaCampaignID] ) ) )
Best Regards!
Dale
Thank you very much, Dale.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
117 | |
101 | |
71 | |
61 |