Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

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...
  • Anonymous's avatar
    Anonymous
    2 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
        )
    )