Forum Discussion
navarrobr
9 years agoFrequent Visitor
SUMIF Equivalent in DAX
Hi everyone! I have a simple situation here, but can't figure out how to solve it. Imagine the following data model: What I need is a measure (or maybe a column?) that shows the sum of...
- 9 years ago
Now it worked! :smileyhappy:
Intercompany Hours = SUMX(filter('Hour';related(Project[Project_company])<>related(User[User_company]));sum('Hour'[Hours]))
dedelman_clng
9 years agoCommunity Champion
I would think you would want to change to SUMX and use RELATED
CALCULATE( SUMX (Hours, Hours[Hours]), RELATED(Project[Company]) <> RELATED(User[Company]) )
Hope this helps,
David
navarrobr
9 years agoFrequent Visitor
Hi David and Vanessa,
Here is a link to my example file: http://www.syscope.com.br/files/example.zip
Here is the data model:
Here is the data, my expression should show the 10 hours below (where the user company is different from the project company):
This is the error I got with my formula:
And David, this is the error I got from your formula:
- navarrobr9 years agoFrequent Visitor
Now it worked! :smileyhappy:
Intercompany Hours = SUMX(filter('Hour';related(Project[Project_company])<>related(User[User_company]));sum('Hour'[Hours]))