Forum Discussion
Distinctcount of values from multiple columns.
Hello,
I am trying to analyse all the sourcing projects. We have 10 different columns for each Vendor and its price. I want to have a measure which shows me distinct count of all the vendors combined. Same vendors could appear in multiple columns due to multiple projects. Please see below the type of data I have.
So the result should be, 15 distinct Vendors for below example. Any suggestions? Plese remember, I have 10 such columns with half a million rows.
Thanks.
| Vendor 1 | Vendor 1 price | Vendor 2 | Vendor 2 price | Vendor 3 | Vendor 3 price |
| ABC | 55 | LMN | 16 | DEF | 92 |
| XYZ | 74 | ABC | 82 | FLS | 22 |
| PQRS | 41 | STO | 85 | JWB | 69 |
| LMN | 49 | FRA | 67 | FSV | 34 |
| DEF | 92 | GFR | 35 | ABC | 42 |
| HIJ | 65 | PQRS | 40 | LWC | 95 |
| ZAC | 57 | DEF | 33 | PQRS | 26 |
Hi vvibhakar ,
Click Query Editor->Transform, click on column [Vendor1] [Vendor2] [Vendor3], then click Unpivot.
After close and applied, create a measure using DAX like this:
Number = DISTINCTCOUNT(Table1[Value])
Regards,
Jimmy Tao
2 Replies
- v-yuta-msft
Community Support
Hi vvibhakar ,
Click Query Editor->Transform, click on column [Vendor1] [Vendor2] [Vendor3], then click Unpivot.
After close and applied, create a measure using DAX like this:
Number = DISTINCTCOUNT(Table1[Value])
Regards,
Jimmy Tao
- Ashish_Mathur
Super User