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

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

Reply
rds_2019
Helper I
Helper I

Counting All Distinct values without using specific Filter

Hi All,

 

I am trying to count values in columns without using specifc filter for 1 conditions how this can be done, this can be done quite easily using Grouping in SQL but not sure about Power BI:-

 

1. With single query how can i get total number of count for column1 WITHOUT USING FILTER ON ANY SPECIFIC VALUE, thus saying:-

a=4 , b=5 and c=2

2.With second query how can i count column2 based on column 1 WITHOUT USING FILTER ON ANY SPECIFIC VALUE of column1, so answer shud be 

For column1=a, tt=2

For column1=a, ss=2

For Column1=b, gg=3

For Column1=b, rr=1

For Column1=b, tt=1

For Column1=c,ss=1

For Column1=c,ff=1

 

 

Column 1Column2
att
att
ass
ass
bgg
bgg
bgg
brr
btt
css
cff

 

 

Thanks and Regards,

Raman

2 REPLIES 2
HotChilli
Super User
Super User

Create 2 measures, both will be simple COUNT.

Here's one, you do the other

Measure1 = COUNT('Table X'[Column 1])

For your first query, drag Column 1 and Measure 1 on to a table.

For your 2nd query, drag Column 1, Column 2 and Measure 2 on to another table

Hi ,

Thank you for quick respone on this. It did work well for first question but for second i tried to use this in the bar chart but apparently what ever gets dragged first in the "AXIS" section it rules the result in bar chart.

So it end up working like single level grouping instead of 2 level of grouping.

 

Thanks,

Raman

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.