Forum Discussion
How to compare/calculate between two columns from different tables with missing values?
- Anonymous2 years ago
Hi Joshva ,
bjertf , thanks for your concern about this case. I tried to create a sample data myself based on the user's requirement. Please check if there is anything that can be improved. Here is my solution:
1.Create simple data:
2.In Power Query Editor, append the two tables into a single table:
The relationship is as follows:
3.Create a new measure:
Measure = VAR _sum1 = CALCULATE(SUM(A[Amount]),FILTER(ALL(A),'A'[ID] = MAX('Append1'[ID]))) VAR _sum2 = CALCULATE(SUM(B[Amount]),FILTER(ALL(B),'B'[ID] = MAX('Append1'[ID]))) RETURN _sum1 - _sum24.The final result is as follows:
Best Regards,
Zhu
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Hi Joshva ,
bjertf , thanks for your concern about this case. I tried to create a sample data myself based on the user's requirement. Please check if there is anything that can be improved. Here is my solution:
1.Create simple data:
2.In Power Query Editor, append the two tables into a single table:
The relationship is as follows:
3.Create a new measure:
Measure =
VAR _sum1 = CALCULATE(SUM(A[Amount]),FILTER(ALL(A),'A'[ID] = MAX('Append1'[ID])))
VAR _sum2 = CALCULATE(SUM(B[Amount]),FILTER(ALL(B),'B'[ID] = MAX('Append1'[ID])))
RETURN
_sum1 - _sum2
4.The final result is as follows:
Best Regards,
Zhu
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
Didn't completely work for me, but you were great inspiration for my solution, thanks!