- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No SUMIF in DAX. Please help with this SUM/LOOKUP/FILTER
Hi everyone. I'm really hoping for a simple and logical solution please.
I am from the Excel world where this would be an easy SUMIF formula, but I am stumped in DAX. Not sure the best function to apply.
I have two tables but they CANNOT be related in the PBI data model (due to other conflicting relationships).
I think the diagram explains everything......
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jihwan_Kim's solution was a great help, but created a measure. This was no good because I needed to do further calculateions and required a calculated column.
For others that may need help with SUMIF in DAX, this is what worked in the end.....
Calculated Column:
Expense = CALCULATE(
SUM(tblExpenses[Amount]),
FILTER(
tblExpenses,
tblActivities[ActivityId] = CALCULATE(VALUES(tblExpenses[ActivityID]))
)
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jihwan_Kim's solution was a great help, but created a measure. This was no good because I needed to do further calculateions and required a calculated column.
For others that may need help with SUMIF in DAX, this is what worked in the end.....
Calculated Column:
Expense = CALCULATE(
SUM(tblExpenses[Amount]),
FILTER(
tblExpenses,
tblActivities[ActivityId] = CALCULATE(VALUES(tblExpenses[ActivityID]))
)
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
Expense measure: =
SUMX (
FILTER ( expenses, expenses[activity_id] IN VALUES ( activities[activity_id] ) ),
expenses[amount]
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks so much for the suggestion Jhiwan_Kim. And a big thank you for the sample file. You are amazing 🙂
From your file - ultimetly, I want to add Cost_01 + Cost_02 + Expense.
I think this is not possible when we use a Measure. Perhaps there is another solution to get the Expense using a Calculated Column rather than a Measure???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am not 100% sure if I understood your question correctly, but please try something like below. It is writing a measure.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Read about TREATAS. It allows you to carry filters between unrelated tables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Ibendlin. So many functions !!!
I have a (sort of) working solution CALCULATE(SUM(FILTER
And Jhiwan_Kim sugested a SUMX(FILTER IN VALUES
I will read about TREATAS and see how that might help.

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
12-14-2023 10:47 AM | |||
07-28-2023 08:48 AM | |||
02-16-2024 08:25 AM | |||
02-18-2024 09:32 AM | |||
04-19-2024 08:50 AM |
User | Count |
---|---|
24 | |
12 | |
11 | |
10 | |
9 |
User | Count |
---|---|
18 | |
14 | |
13 | |
12 | |
10 |