Forum Discussion
KatkaS
Post Patron
6 years agoVlookup and calculation
Hello, I'm struggling with following: I have two tables and I need to calculate the difference between amounts in two columns (one in each table), based on the FAM line (4+ digit number). Coul...
- 6 years ago
Hi KatkaS ,
Please create the columns in Data View or Report View, not Power Query Editor. These are DAX expressions.
Best Regards,
Icey
Icey
Community Support
6 years agoHi KatkaS ,
Try this:
1. Change the data type of '2nd source SAP'[FAM Line] to 'Text'.
2. Create columns in '2nd source SAP'.
Amount of 1st =
CALCULATE (
SUM ( '1st source ECS'[AMOUNT] ),
FILTER (
'1st source ECS',
[BALANCE SHEET + INCOME STATEMENT - Copy.1.2]
= EARLIER ( '2nd source SAP'[FAM Line] )
&& [PERIOD] = EARLIER ( [PERIOD] )
&& [FAM] = EARLIER ( '2nd source SAP'[Operational Company] )
)
)Difference = '2nd source SAP'[YTD]-'2nd source SAP'[Amount of 1st]
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.