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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Need help in DAX

Hello Everyone, 

Please can some help me with the below logic uisng the DAX funnction or M-query. 

Note the below input is using the direct query mode report


Current Table :

 

Match ID

Category

123457

Climate Environment

316789

Climate Environment

215789

Climate Environment

123457

Climate Environment

123457

Climate Environment

215789

Geo Climate

215789

Geo Climate



Need the Output

 

Match ID

Category

Distinct count of Match ID by Category

123457

Climate Environment

 

316789

Climate Environment

 

215789

Climate Environment

 

123457

Climate Environment

 

123457

Climate Environment

 

215789

Geo Climate

 

215789

Geo Climate

 



1 ACCEPTED SOLUTION
Whitewater100
Solution Sage
Solution Sage

Hello:

 

You can try this:  DISTINCTCOUNT =

 VAR _matchID = Current[MatchID}

   VAR _ Category = Current[Category]

Return
COUNTROWS(

                  FILTER(
                        ALL( ‘Current’),

Current[MatchID} = _matchID &&

Current[Category] = _Category)
)

I hope this helps you!

View solution in original post

2 REPLIES 2
PaulOlding
Solution Sage
Solution Sage

Hi @Anonymous 

This DAX is for a measure to get the distinct count

Distinct count of Match ID by Category = 
CALCULATE(
    DISTINCTCOUNT('Table'[Match ID]),
    ALLEXCEPT('Table','Table'[Category])
)
Whitewater100
Solution Sage
Solution Sage

Hello:

 

You can try this:  DISTINCTCOUNT =

 VAR _matchID = Current[MatchID}

   VAR _ Category = Current[Category]

Return
COUNTROWS(

                  FILTER(
                        ALL( ‘Current’),

Current[MatchID} = _matchID &&

Current[Category] = _Category)
)

I hope this helps 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.