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
parzival1220
Frequent Visitor

Counting Records With a Certain Value

Hi there,

 

Apologies if this topic has been covered before, but I couldn't find anything quite like this in other threads. 

 

I have a dataset with a number of fields that contain either a 'Y' or 'N' value. The data is all imported into Power BI via a SQL script (Import Query). The columns look like this in the SQL output:

 

parzival1220_1-1678103443410.png

 

I need to produce a bar graph (or similar visualisation) that only counts the number of 'Y' values in each column. The idea is that the end result will be a visual that the user will be able to interact with, e.g. the user will be able to click on the visual and see all the records with a 'Y' in the column they have selected. 

 

Is there a specific function / approach I could use please? I've had a go with DAX, but that's pushing me down the measures route and my team would like an interactive visual for ease of use.

 

Many thanks in advance and please do ask if any further info is required 🙂

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@parzival1220 , Better you unpivot the table and then use it

 

Unpivot Data(Power Query): https://youtu.be/2HjkBtxSM0g

 

https://radacad.com/pivot-and-unpivot-with-power-bi

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
parzival1220
Frequent Visitor

Thanks @amitchandak . That worked a treat 👍

parzival1220
Frequent Visitor

Thanks very much @amitchandak . I'll give it a try 🙂

amitchandak
Super User
Super User

@parzival1220 , Better you unpivot the table and then use it

 

Unpivot Data(Power Query): https://youtu.be/2HjkBtxSM0g

 

https://radacad.com/pivot-and-unpivot-with-power-bi

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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
Top Kudoed Authors