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
TodS9
New Member

Grouping or goup by, DAX, Query or SQL

Thank you ahead of time. Below is a simplified table where I want to count how many EN users selected Chat.

I was trying to figure out how to group the information of the User and count if both EN and Chat were in the grouping but I don't have the knowledge how to do it.

UserOperationDescriptionSelection
User1MenuLanguageEN
User1MenuSalesParts
User1XferSMSChat

User2

MenuLanguageES
User2MenuSalesNew
User2XferLiveAgent

User3

MenuLanguageEN
User3MenuServiceReturns
User3XferLiveChat

 

4 REPLIES 4
EylesIT
Resolver II
Resolver II

@TodS9, here is my suggested solution.

 

Create a measure called [Has EN and Chat] with this DAX formula:

 

 

Has EN and Chat = 
    SUMX(
        VALUES(YourTable[User]),
        VAR hasEN = CALCULATE(DISTINCTCOUNT(YourTable[User]), YourTable[Selection] = "EN")
        VAR hasChat = CALCULATE(DISTINCTCOUNT(YourTable[User]),YourTable[Selection] = "Chat")
        RETURN IF(hasEN > 0 && hasChat > 0, 1)
    )

 

 

 

Add a table visual to your report and drag the [User] column and the [Has EN and Chat] mesaure. This gives the output below:

EylesIT_1-1698257731819.png

 

Is this what you are looking for?

 

Anonymous
Not applicable

Thanks @EylesIT , I was able to get the data needed. It would have been weeks if ever for me to figure this out. There's another column I want to show as the rows and not the "User" but I'll work on that. Awesome answer.

Greg_Deckler
Community Champion
Community Champion

@TodS9 Try:

Measure =
  VAR __Table1 = SELECTCOLUMNS( FILTER( 'Table', [Selection] = "EN" ), "User", [User])
  VAR __Table2 = SELECTCOLUMNS( FILTER( 'Table', [Selection] = "Chat" ), "User", [User])
  VAR __Result = COUNTROWS(INTERSECT( __Table1, __Table2 ) )
RETURN
  __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Thanks @Greg_Deckler . This answer may allow me to get the information in the layout I eventually want. It's just going to take some extra time to learn and understand how it works. You guys are fantastic. I've been staring at this for a couple of weeks before breaking down and asking for help. Thank you!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.