Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Totals not correct

Hi,

 

I'm trying to get a total cost of 7.4k in Column3 based on the values in Column1 that are "True". I've written a measure that singles out the value that is True, and marks 0 for everything else. 

 

That measure is 

Column3 = if(CONTAINS(Table1,Table1[Column1],"True"), [Column2],0)
 
However, the totals on the bottom are incorrect for Column 3. It's giving me the same total as Column 2 of 64k when it should be giving me the 7k value. How can I fix this? Thanks in advance.
 

 

 

 

  • Anonymous 

    Try a measure like this.

    Column3 =
    CALCULATE ( SUM ( Table1[Column2] ), KEEPFILTERS ( Table1[Column1] = "True" ) )
    

4 Replies

  • Anonymous 

    Try a measure like this.

    Column3 =
    CALCULATE ( SUM ( Table1[Column2] ), KEEPFILTERS ( Table1[Column1] = "True" ) )
    
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi jdbuchanan71 

       

      Thanks for your response.

       

      I cannot do SUM(Table1[Column2] because Column2 is also a measure.

      • Anonymous's avatar
        Anonymous
        Not applicable

        jdbuchanan71 Actually I just used your formula and removed the SUM part of it and it worked perfectly. Thank you so much!