Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Lookupvalue two tables with multiple criteria

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 GroupAccountCosts
ID 1ABC11000
ID 1ABC2

2000

ID 1ABC33000
ID 2ABC1500
ID 2ABC21000
ID 2ABC32000

 

1 ACCEPTED SOLUTION
Sahir_Maharaj
Super User
Super User

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.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Sahir_Maharaj  Thank you! Works so well!

Sahir_Maharaj
Super User
Super User

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.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors