Forum Discussion
Subtract columns from 2 different tables
- Anonymous4 years ago
Hi Anonymous ,
Using a date table and a table with an item column and creating a relationship with the original table is a workable solution.
For example. First create two calculated tables.
Date = CALENDAR(MIN('Table 1'[Date]),MAX('Table 2'[Date]))Table 3 = VALUES('Table 1'[Item])Then create the following relationship.
If you want the calculated column.
Column = VAR _qty_1 = CALCULATE(SUM('Table 1'[Qty])) var _qty_2 = CALCULATE(SUM('Table 2'[Qty])) return _qty_1-_qty_2If what you want is a measure, you can use your original expression and drag it into the visual along with columns
'Date'[Date] and 'Table 3'[Item].Attach the PBIX file for reference. Hope it helps.
Best Regards,
Community Support Team_GaoIf 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!
How to get your questions answered quickly -- How to provide sample data
Hi Anonymous ,
Using a date table and a table with an item column and creating a relationship with the original table is a workable solution.
For example. First create two calculated tables.
Date = CALENDAR(MIN('Table 1'[Date]),MAX('Table 2'[Date]))
Table 3 = VALUES('Table 1'[Item])
Then create the following relationship.
If you want the calculated column.
Column =
VAR _qty_1 = CALCULATE(SUM('Table 1'[Qty]))
var _qty_2 = CALCULATE(SUM('Table 2'[Qty]))
return
_qty_1-_qty_2
If what you want is a measure, you can use your original expression and drag it into the visual along with columns
Attach the PBIX file for reference. Hope it helps.
Best Regards,
Community Support Team_Gao
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!
How to get your questions answered quickly -- How to provide sample data
- Anonymous4 years agoNot applicable
That worked! Thank you so much. Anonymous