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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jmscrx
Helper I
Helper I

% of unique values in a column based on the value of another column?

Hi folks, new to the community and PowerBI. I've been able to solve most of my basic issues so far via searching here and trial and error, thanks for all your contributions to this community. It's amazing how well versed everyone is with such a powerful tool.

 

Anyway, my data is similar to the below.

 

Vendor NameNeeds Remediation
Vendor1Yes
Vendor1Yes
Vendor2No
Vendor2No
Vendor2No
Vendor2No
Vendor3No
Vendor3Yes
Vendor3Yes
Vendor3Yes
Vendor3Yes
Vendor3No

 

What I'd like to do with a visual is to calculate/display the "percentage of vendors with findings that need remediation." I'm not sure if this would be a measure, calculated column or similar and the likely needed DAX is a bit over my head at this early stage. So with the above data my outcome would simply be a percentage that considered Vendor1 and Vendor2 (2 total unique vendors) as a percentage of all unique vendors (3 total in this case). Said differently, I want to calculate the percentage of unique vendors with a Yes in column 2 based on the number of overall unique vendors from column 1. 

 

In this case it would be 2 unique vendors calculated as a percentage of 3 total. I hope I'm explaining this correctly and feel like I'm over thinking it :). Thanks!

 

1 ACCEPTED SOLUTION

Thanks for the quick reply, this makes sense and seems to work when used in a card visual!!!

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

You probably want a measure similar to this:

NeedsRemediation% =
DIVIDE (
    CALCULATE (
        DISTINCTCOUNT ( Table1[Vendor Name] ),
        Table1[Needs Remediation] = "Yes"
    ),
    DISTINCTCOUNT ( Table1[Vendor Name] )
)

Thanks for the quick reply, this makes sense and seems to work when used in a card visual!!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors