Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
vvibhakar
Frequent Visitor

Distinctcount for values from multiple colums

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?

Thanks.

 

Project No.Vendor 1Vendor 1 priceVendor 2Vendor 2 priceVendor 3Vendor 3 price
1ABC97LMN66DEF15
2XYZ24ABC57FLS95
3PQRS26STO66JWB79
4LMN65FRA90FSV39
5DEF64GFR55ABC40
6HIJ80PQRS60LWC72
7ZAC46DEF61PQRS28
1 ACCEPTED SOLUTION

@vvibhakar

 

May be a MEASURE like

 

Measure =
COUNTROWS (
    DISTINCT (
        UNION (
            VALUES ( TableName[Vendor 1] ),
            VALUES ( TableName[Vendor 2] ),
            VALUES ( TableName[Vendor 3] )
        )
    )
)

 

View solution in original post

3 REPLIES 3
sqlguru448
Helper III
Helper III

please try below

 

= DISTINCTCOUNT(Vendor1) +  DISTINCTCOUNT(Vendor2) +  DISTINCTCOUNT(Vendor3)

I had tried already, but it adds up the distinct count. In the given example, the final value still shows 21.

@vvibhakar

 

May be a MEASURE like

 

Measure =
COUNTROWS (
    DISTINCT (
        UNION (
            VALUES ( TableName[Vendor 1] ),
            VALUES ( TableName[Vendor 2] ),
            VALUES ( TableName[Vendor 3] )
        )
    )
)

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.