Forum Discussion
Tech325
6 years agoNew Member
Avoiding Duplicate counts question
I have the below table and would like to visualize the following: To calculate the number of unique Technical IDs in relation to Process A and Process B. For example, there are 6 SAS 234s in rela...
- 6 years ago
Hi Tech325
In Power query, add a custom column below
Then modify measure
Measure = CALCULATE(COUNT(Query1[Process]),FILTER(Query1,[Text After Delimiter]=BLANK())) Measure 2 = SUMX(ALL(Query1[Nature of Business]),[Measure])Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Tech325
6 years agoNew Member
v-juanli-msft Thanks for working on this... it's greatly appreciated. I've noticed that for "Company ABC", if I change the value for Product 325 from "Retail" to "Banking", the output will show that there is only 1 Process B instead of 2 Process Bs.
Any thoughts?
Thanks!
BEFORE
| Product ID | Company | Nature of Business | Process A | Process B | Technical ID | Technical ID 2 | Technical ID 3 |
| 325 | ABC | Retail | 0 | 1 | SAS 234 | ||
| 246 | XYZ | Oil & Gas | 0 | 1 | SAS 234 | SAS 567 | |
| 100 | 123 | Manufacturing | 0 | 1 | SAS 234 | SAS 230 | SAS 205 |
| 112 | 456 | Insurance | 1 | 0 | SAS 234 | ||
| 102 | ABC | Banking | 0 | 1 | SAS 220 | ||
| 325 | XYZ | Retail | 0 | 1 | SAS 220 | ||
| 246 | 123 | Oil & Gas | 0 | 1 | SAS 234 | ||
| 100 | ABC | Manufacturing | 0 | 1 | SAS 234 | SAS 567 | |
| 112 | XYZ | Insurance | 0 | 1 | SAS 234 | SAS 230 | SAS 205 |
| 102 | 123 | Banking | 1 | 0 | SAS 234 | ||
| 100 | 456 | Oil & Gas | 1 | 0 | SAS 220 |
AFTER
| Product ID | Company | Nature of Business | Process A | Process B | Technical ID | Technical ID 2 | Technical ID 3 |
| 325 | ABC | Banking | 0 | 1 | SAS 234 | ||
| 246 | XYZ | Oil & Gas | 0 | 1 | SAS 234 | SAS 567 | |
| 100 | 123 | Manufacturing | 0 | 1 | SAS 234 | SAS 230 | SAS 205 |
| 112 | 456 | Insurance | 1 | 0 | SAS 234 | ||
| 102 | ABC | Banking | 0 | 1 | SAS 220 | ||
| 325 | XYZ | Retail | 0 | 1 | SAS 220 | ||
| 246 | 123 | Oil & Gas | 0 | 1 | SAS 234 | ||
| 100 | ABC | Manufacturing | 0 | 1 | SAS 234 | SAS 567 | |
| 112 | XYZ | Insurance | 0 | 1 | SAS 234 | SAS 230 | SAS 205 |
| 102 | 123 | Banking | 1 | 0 | SAS 234 | ||
| 100 | 456 | Oil & Gas | 1 | 0 | SAS 220 |
v-juanli-msft
6 years agoCommunity Support
Hi Tech325
In Power query, add a custom column below
Then modify measure
Measure = CALCULATE(COUNT(Query1[Process]),FILTER(Query1,[Text After Delimiter]=BLANK()))
Measure 2 = SUMX(ALL(Query1[Nature of Business]),[Measure])
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.