I have a data set that has revenue and base salary by month. I am attempting to put this in a Power Bi Matrix with a DAX measure that calculates by month if the revenue is less than the salary then it is $0 earned and not negative. The issue I’m running into is the “Total” section on the Matrix is not accounting for the logic by month and instead taking total revenue less total salary.
The DAX expression I wrote is: Bonus Earned Calculation = IF(SUM(Example[Revenue])-SUM(Example[Base Salary])<0,0,SUM(Example[Revenue])-SUM(Example[Base Salary]))
Is there a way to write DAX so the Matrix Total (that calculates automatically) is correct?
example of power bi dashboard
I tried tweaking the Bonus Earned Calculation = IF(SUM(Example[Revenue])-SUM(Example[Base Salary])<0,0,SUM(Example[Revenue])-SUM(Example[Base Salary])) formula but I am not quite adept enough to write something that affects the Matrix Total. Any help or ideas would be greatly appreciated! I can also send the example dashboard.
Rachel Hostens is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.