Forum Discussion

geroagostini's avatar
geroagostini
Icon for Helper I rankHelper I
3 years ago
Solved

DAX COUNT based on multiple criteria in same table

Hi,

 

 In the same table ("Table Z") i have 2 columns: Column A and Column B.

 Column A                   Column B

     done                          7261

    on work                    13

    developed                 302

     done                          290

     on work                     913

     approved                   6100

     developed                 120

     on work                     2000

 

 I need to COUNT the values of Column B only when Column A is = "done" OR when Column A = "on work" 

 Could someone please help me

 

  • Anonymous's avatar
    Anonymous
    3 years ago
    Test = Calculate(COUNT(TestTable[B]), TestTable[A] = "done" || TestTable[A] = "on work")
     
     
    Here you go pal, tested it so it should work 🙂 accept as solution if it works for you! 🙂 

8 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Do you mean you need to sum the values instead of count? 🙂 

    • geroagostini's avatar
      geroagostini
      Icon for Helper I rankHelper I

      No! sorry for the confusion. I need to COUNT how many values there are with the criteria of Column A is = "done" OR when Column A = "on work".

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        No Problem! so If we had a working measure, what would you be expecting it to return? 🙂 

  • Anonymous's avatar
    Anonymous
    Not applicable

    For the data you provided, there are 5 columns in A where A = done or on work. 
    Would you expect your measure to return 5?

      • Anonymous's avatar
        Anonymous
        Not applicable
        Test = Calculate(COUNT(TestTable[B]), TestTable[A] = "done" || TestTable[A] = "on work")
         
         
        Here you go pal, tested it so it should work 🙂 accept as solution if it works for you! 🙂