Forum Discussion

0wlish's avatar
0wlish
Frequent Visitor
4 years ago

Calculate x+1 if x

I'm fairly new to DAX so apologies if this is a stupid question. I have spent what feels like ages searching though!

 

I have a table with multiple variables (work types) and I need to increase the count of one variable by the total number of another variable.

 

So for every 1 HIHSYS, I need to increase the total for HIHGAS (and the overall total) by 1. Hope that makes sense. I don't want to group it as I don't want to group other variables.

 

Is there a way of doing this using DAX? I've tried CALCULATE but as they're both in the same column it doesn't like it.

 

I've recreated the table below with dummy data.

 

Workstream1/4/221/5/221/6/221/7/221/8/22
HIHSYS

4

23182
HIGAS3163912
HIGASSYS     
HIHABC238849
HIHBCD621437
HIHCDE20354
TOTAL3849292934

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi 0wlish ,

     

    Does your table look like as above? According to your logic, I think HIGAS in same 2022/04/01 should return 4+1 =5.

    Please show me more details about your data model and show me a screenshot with the result you want. This will make it easier for me to find the solution.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • 0wlish's avatar
      0wlish
      Frequent Visitor

      No so the totals in the table are aggregates of individual orders of that work type (total = count('table'[order_no]).  I need to create a new worktype variable that is HIHGAS+HISYS, distinct from HIHGAS