Forum Discussion
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.
| Workstream | 1/4/22 | 1/5/22 | 1/6/22 | 1/7/22 | 1/8/22 |
| HIHSYS | 4 | 23 | 1 | 8 | 2 |
| HIGAS | 3 | 16 | 3 | 9 | 12 |
| HIGASSYS | |||||
| HIHABC | 23 | 8 | 8 | 4 | 9 |
| HIHBCD | 6 | 2 | 14 | 3 | 7 |
| HIHCDE | 2 | 0 | 3 | 5 | 4 |
| TOTAL | 38 | 49 | 29 | 29 | 34 |
2 Replies
- AnonymousNot 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 ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 0wlishFrequent 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