Forum Discussion

Bpark1994's avatar
Bpark1994
Helper I
5 years ago

Need Dax Help Please!

Hi guys

 

I have 2 tables. They are related through the Task column

 

i need to write a calculated column that gives me a count of each task. Seems simple but the part that's tripping me up is if the task is task 3 or 4 then I need the count of those together in the calculated column. The one I wrote doesn't add them together. Here is an example table and my desired result. Thanks!

 

NameTask
John1
John1
John2
Jim1
Jim2
Jane1
Jane2
Mike3
Mike4
Evan3
Evan4

 

 

desired result

TaskCalculated column count
14
23
34
44

3 Replies

    • Bpark1994's avatar
      Bpark1994
      Helper I

      Sorry this is not the desired result I am looking for. I don't just want to count the tasks, I also need conditional logic that adds tasks 3 and 4 together as described above. I appreciate the help though!

  • Bpark1994 , Try a measure like

    Measure 2 = if( max('Table'[Task]) in {3,4} ,CALCULATE(COUNT('Table'[Name]), 'Table'[Task] in {3,4}), COUNT('Table'[Name]))