Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Sum values from column without specific records

Hello. I am trying to sum values form a column but without specific records that are called "WAY TO FIRST CLIENT" and "WAY BACK HOME". The formula I am trying to use is below but it doesn't work. Could somebody please help me with that?

 

Measure = CALCULATE(SUM(Table[Column]);FILTER(Table;"WAY TO FIRST CLIENT" AND "WAY BACK HOME"))
  • Hi Anonymous 

    You can try something like below, but if you provide a data sample its always better.

    Measure = 
    CALCULATE(
        SUM( YourTable[ValueColumn] ),
        YourTable[FilterColumn] IN { "WAY TO FIRST CLIENT", "WAY BACK HOME" }
    )
    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski

     

5 Replies

  • Mariusz's avatar
    Mariusz
    Community Champion

    Hi Anonymous 

    You can try something like below, but if you provide a data sample its always better.

    Measure = 
    CALCULATE(
        SUM( YourTable[ValueColumn] ),
        YourTable[FilterColumn] IN { "WAY TO FIRST CLIENT", "WAY BACK HOME" }
    )
    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you so much Mariusz it works! :smileyhappy:

    • Anonymous's avatar
      Anonymous
      Not applicable

      Mariusz I am sorry but the formula you've given me sums visits "WAT TO FIRST CLIENT" and "WAY BACK HOME" and I would like to sum everything WITHOUT these 2. What should I use instead "IN" in formula? 

      • Anonymous's avatar
        Anonymous
        Not applicable

        I worked it out I added "NOT" before Visits[VisitClientName]. You can see it below. 

         

        Time spent in shops = CALCULATE(
        SUM(Visits[Visit time]);
        NOT OM_Visits[VisitClientName] IN { "WAY TO FIRST CLIENT"; "WAY BACK HOME"}
        )/60