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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
CoQu9
New Member

Group Values

Hi all, 

 

I am a relatively experienced Power BI/Power Query user but I am running into a problem with a new dataset I am working with. The data has repeat values and I need to report out things such as, "how many states have a F employee". I'm struggling with how to do this in Power Query or Power BI. Is there a calculation that would automatically group all three CA rows so that if I asked for a count of F it would say 2? 

 

Work SiteFunctionGender
CAPRF
CAEngF
CAHRM
MTHRM
MTHRF
TXENGM

 

Thank you!

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

I would group by State AND Gender, and then add a Count Aggregation.

 

--Nate 

View solution in original post

BA_Pete
Super User
Super User

Hi @CoQu9 ,

 

You can create DISTINCTCOUNT measures to tackle this particular issue.
For example, the following will output 2:

_StatesWithF = 
CALCULATE(
    DISTINCTCOUNT('Table'[Work Site]),
    'Table'[Gender] = "F"
)

 

My example measure is specific to this one requirement, but the use of DISTINCTCOUNT is what you're looking for to solve your overall need.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
BA_Pete
Super User
Super User

Hi @CoQu9 ,

 

You can create DISTINCTCOUNT measures to tackle this particular issue.
For example, the following will output 2:

_StatesWithF = 
CALCULATE(
    DISTINCTCOUNT('Table'[Work Site]),
    'Table'[Gender] = "F"
)

 

My example measure is specific to this one requirement, but the use of DISTINCTCOUNT is what you're looking for to solve your overall need.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

I would group by State AND Gender, and then add a Count Aggregation.

 

--Nate 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors