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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
cwg
New Member

Show count of rows with a certain value as a percentage of all rows

Hello all

 

I have a table that lists, for example, Customers, with each Customer record having an attribute to say whether or not they've made a purchase.

Customer ID | Purchase Made?

========================

0001             | Yes

0002             | Yes

0003             | No

0004             | No

0005             | Yes

0006             | Yes

 

I want a Measure (at least I think that's what I need) showing the number of Customers where Purchase Made = Yes, as a percentage of the total number of customers.

 

I'm fairly new to DAX, so any help would be appreciated.

 

 

Thanks

 

Chris

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

@cwg

How about building the Measure you need like this

as Rob Colie says "Never write the same formula twice!"

Total Customers = DISTINCTCOUNT ( Table[CustomerID] )

Number of Customers (who made a Purchase) = CALCULATE ( [Total Customers], FILTER ( Table, Table[Purchase Made?] = "Yes" ) )
% of Customers who made a Purchase =
DIVIDE ( [Number of Customers (who made a Purchase)], [Total Customers], 0 )

Also take a look here for future reference if you need to add additional conditions later on

https://www.sqlbi.com/articles/filter-arguments-in-calculate/

Hope this helps! Smiley Happy

View solution in original post

1 REPLY 1
Sean
Community Champion
Community Champion

@cwg

How about building the Measure you need like this

as Rob Colie says "Never write the same formula twice!"

Total Customers = DISTINCTCOUNT ( Table[CustomerID] )

Number of Customers (who made a Purchase) = CALCULATE ( [Total Customers], FILTER ( Table, Table[Purchase Made?] = "Yes" ) )
% of Customers who made a Purchase =
DIVIDE ( [Number of Customers (who made a Purchase)], [Total Customers], 0 )

Also take a look here for future reference if you need to add additional conditions later on

https://www.sqlbi.com/articles/filter-arguments-in-calculate/

Hope this helps! Smiley Happy

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors