The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I have below two tables.
I try to calculate the column "Column to Calculate" using 'Tabel1' [Cost Group] to lookup in 'Tabel2' [Cost Group] and 'Tabel2' [Account] with only ABC1 and ABC2.
The IN does not really work so looking for other ways.
Tabel1:
Cost Group | Column to Calculate |
ID 1 | Lookupcalue('Tabel2'[Costs], 'Tabel2'[Cost Group], 'Tabel1'[Cost Group], 'Tabel2', IN {"ABC1", "ABC2"}) =3000 |
ID 2 | |
ID 3 | |
ID 4 | |
ID 5 |
Tabel 2:
Cost Group | Account | Costs |
ID 1 | ABC1 | 1000 |
ID 1 | ABC2 | 2000 |
ID 1 | ABC3 | 3000 |
ID 2 | ABC1 | 500 |
ID 2 | ABC2 | 1000 |
ID 2 | ABC3 | 2000 |
Solved! Go to Solution.
Hello @Anonymous,
Can you please try this DAX:
Column to Calculate =
CALCULATE(
SUM('Table2'[Costs]),
FILTER(
'Table2',
'Table2'[Cost Group] = 'Table1'[Cost Group] &&
('Table2'[Account] = "ABC1" || 'Table2'[Account] = "ABC2")
)
)
Should you require any further assistance, please do not hesitate to reach out to me.
Hello @Anonymous,
Can you please try this DAX:
Column to Calculate =
CALCULATE(
SUM('Table2'[Costs]),
FILTER(
'Table2',
'Table2'[Cost Group] = 'Table1'[Cost Group] &&
('Table2'[Account] = "ABC1" || 'Table2'[Account] = "ABC2")
)
)
Should you require any further assistance, please do not hesitate to reach out to me.