Forum Discussion
Anonymous
2 years agoNot applicable
DAX Error SUMX
Hi, I'm working on a DAX and not getting the expected results. It seems that at a line item level it is calculating correctly however, at the total level it is not summing but performing the cal...
- Anonymous2 years ago
Hi,
I was able to find the solution. I was using SUMX on the connected tables but I needed to use it with a summarize on the table where the line item data is housed. He is what my code ended up looking like.
SUMX(SUMMARIZE('WagesHomeCC and Fringe Line Items','WagesHomeCC and Fringe Line Items'[Date], 'WagesHomeCC and Fringe Line Items'[Cost Ctr]),IF(NOT(ISBLANK([Wages on Flat Units])),CALCULATE(SUM('WagesHomeCC and Fringe Line Items'[Amount]),Account_Map[Lvl 2] = "Total PR Tax"),0))
Jihwan_Kim
Super User
2 years agoHi,
I am not sure how your semantic model looks like, but please try something like below whether it suits your inquiry.
SUMX (
VALUES ( 'Calendar'[Calendar] ),
IF (
NOT ( ISBLANK ( [Wages on Flat Units] ) ),
CALCULATE (
SUM ( 'WagesHomeCC and Fringe Line Items'[Amount] ),
Account_Map[Lvl 2] = "Total PR Tax"
),
0
)
)