Forum Discussion
DAX compare data from different tables
- Anonymous7 years ago
While this can be solved in DAX, the cleaner way to do it is to transform your data so that you have a snowflake schema with two fact tables. What you want to do is create a tables with distinct customer code then link this to both tables, as you have done with the calendar tables. You will also need to delete the relationship between the two fact tables.
This is by far the best way to solve this, it is possible with measures or with a different model.
- 7 years ago
You may change the relationships and then use the measure Difference1. Attached the sample file for your reference.
Regards,
Cherie
You may change the relationships and then use the measure Difference1. Attached the sample file for your reference.
Regards,
Cherie
- shoebhakeem1237 years agoFrequent Visitor
I guess this would work.. Thank you so much.
- shoebhakeem1237 years agoFrequent Visitor
Hi Team,
Thank you for the post. This works when we have distinct employee codes in both tables.
In my case, I have payroll comparison of the same data coming from two different sources, for some reason.
To be more precise, I have 1000 plus employees each month. All employees are repeated every month except for a few termination cases and new hires.
When I apply your solution, the table 2 salary is getting aggregated and if I select do not summarize, POWER BI sends out a relationship error.
Please see the screenshots.
Relationship errorAuto AggregationModel
- v-cherch-msft7 years ago
Microsoft Employee
- shoebhakeem1237 years agoFrequent Visitor
I tried but no change in result.:smileysad: