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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
veefly21
New Member

Distinct Count of unique values in one column based on unique values in another column

New to Power Bi

I am trying to count unique values (2 values) in one column based off unique values in another column. I have two columns, one is type and the other is Chargeable incident. I am trying to get a count when column type has sms and the chargeable incident column has either osha or osha_lti.  With the below data, I would like to get a count of 3. There is always a vaule in the type column, but not in the chargeable column. 

Thank you in advance

 

TypeChargeable incident
smsosha
tmsosha
smsosha_lti
tms 
sms 
smsosha
tmsosha_lti
mms 
mmsosha

 

2 ACCEPTED SOLUTIONS
negi007
Community Champion
Community Champion

@veefly21  you can create a measure like below

Count_Chareable = CALCULATE(COUNT('Table'[Chargeable incident]),'Table'[Chargeable incident]="osha" || 'Table'[Chargeable incident]= "osha_lti")
 
negi007_0-1671169821914.png

 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

View solution in original post

@veefly21  adding to @negi007 measures.
you can use below measure
1st requirement =  CALCULATE(distinctCOUNT('Table'[Chargeable incident]),'Table'[Chargeable incident]="osha" || 'Table'[Chargeable incident]"osha_lti")


2nd requirement with sms =  CALCULATE(distinctCOUNT('Table'[Chargeable incident]),'Table'[Chargeable incident]="osha" ,Table'[Chargeable incident]= "osha_lti", type = "SMS" )

to get value with SMS.

Give Kudos if above solution as per your requirement.

Thanks /

Harish Mishra

View solution in original post

4 REPLIES 4
veefly21
New Member

Thank you. I got it to work. It was user error on my part, I was still not getting the results that you showed me. Finally got it. I am going to need a lot more pratice and learning to get better. 

veefly21
New Member

Thank you for your help. I have that measure that captures the total osha and osha_lti on a card. I wanted to add another card that only shows the osha and osha_lti that are assoicated with only sms. So I would have one card showing total osha and osha_lti (6) and another card showing only osha and osh_lti associated with sms (3). Tried to use calculate count with an && and a ||  with 2 columns and did not work. The error was due to using two columns.    

 

 

@veefly21  adding to @negi007 measures.
you can use below measure
1st requirement =  CALCULATE(distinctCOUNT('Table'[Chargeable incident]),'Table'[Chargeable incident]="osha" || 'Table'[Chargeable incident]"osha_lti")


2nd requirement with sms =  CALCULATE(distinctCOUNT('Table'[Chargeable incident]),'Table'[Chargeable incident]="osha" ,Table'[Chargeable incident]= "osha_lti", type = "SMS" )

to get value with SMS.

Give Kudos if above solution as per your requirement.

Thanks /

Harish Mishra

negi007
Community Champion
Community Champion

@veefly21  you can create a measure like below

Count_Chareable = CALCULATE(COUNT('Table'[Chargeable incident]),'Table'[Chargeable incident]="osha" || 'Table'[Chargeable incident]= "osha_lti")
 
negi007_0-1671169821914.png

 




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.