Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Column total not adding to the total sum

Hi,

I'm aware this has been asked before, but I was not able to find a solution with the previous quesitons. 
Measure that I'm creating is not adding up to the correct total. 
My measure looks like this: 

Usage Cost = CALCULATE(SUM('Table1'[Total Cost (LCY)]), 'Table1' [Source] <> 1, 'Table2' [Project Type] = 0)

 

When selecting three ID's I'm getting this output.

 

IDUSAGE COST
1512 114
2220 779
3235 045
Total967 938

 

This should add up to 1,024,285.9 

 

 

I have no changed it to an if statement that looks like this, but not working:


Usage Cost = IF(HASONEFILTER('Table'[Job No_]),

CALCULATE(SUM('Table1'[Total Cost (LCY)]),

    'Table'[Source Type] <> 1, Table2[Project Type] = 0),

    CALCULATE(SUM('Table'[Total Price (LCY)]),

    ALLEXCEPT('Table', 'Table'[Source Type])) <> 1)
 
This is giving me "True" for total, which means my result if false statement needs fixing, but not sure what

How can I fix this? Thanks

 

THanks

6 Replies

  • Try like

    Usage Cost = CALCULATE(SUM('Table1'[Total Cost (LCY)]),values(Table1[ID]), 'Table2' [Project Type] <> 0)
    • Anonymous's avatar
      Anonymous
      Not applicable

      Still getting the same total..

  • Icey's avatar
    Icey
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    If you don't mind, please share me some sample data, not real data.

     

     

    Best Regards,

    Icey

  • Icey's avatar
    Icey
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    Is this problem solved now?

     

     

    Best Regards,

    Icey