Forum Discussion

vvibhakar's avatar
vvibhakar
Frequent Visitor
8 years ago
Solved

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 1Vendor 1 priceVendor 2Vendor 2 priceVendor 3Vendor 3 price
ABC55LMN16DEF92
XYZ74ABC82FLS22
PQRS41STO85JWB69
LMN49FRA67FSV34
DEF92GFR35ABC42
HIJ65PQRS40LWC95
ZAC57DEF33PQRS26
  • 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's avatar
    v-yuta-msft
    Icon for Community Support rankCommunity 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