Forum Discussion
Anonymous
4 years agoNot applicable
DAX
I have a table,
| Network Name | Office Name | Status |
| A | O1 | C |
| A | O1 | C |
| A | O2 | C |
| A | O6 | NC |
| A | O3 | C |
| B | O4 | C |
| B | O5 | NC |
| C | O7 | C |
| D | O8 | NC |
Now I wanted to add a new column called result which has the count of unique office in a network that has status C.
The output table should look like,
| Network Name | Office Name | Status | Result |
| A | O1 | C | 3 |
| A | O1 | C | 3 |
| A | O2 | C | 3 |
| A | O6 | NC | 3 |
| A | O3 | C | 3 |
| B | O4 | C | 1 |
| B | O5 | NC | 1 |
| C | O7 | C | 1 |
| D | O8 | NC | 0 |
Please help me with this query.
Hey Anonymous ,
Try :results = Calculate(DISTINCTCOUNT(Table[NameOffice]),Filter(ALL(Table),Table[Network] == EARLIER(Table[Network])
&&
Table[NameStatus] == "C"
))
Best regards,
2 Replies
- philouduvResolver III
Hey Anonymous ,
Try :results = Calculate(DISTINCTCOUNT(Table[NameOffice]),Filter(ALL(Table),Table[Network] == EARLIER(Table[Network])
&&
Table[NameStatus] == "C"
))
Best regards,- AnonymousNot applicable
Perfect... Thank you