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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

DAX help group by distinct count measure

Hello,

I am a recent user of PBI and i am struggling with some data.

I need help to write two measures:

- one measure that group by "bank" and count unique "process" with errors

- one measure that group by "bank" and count total number of unique process received

 

here is the table and the desired results:

Capture.PNG

 

Thank you in advance!

1 ACCEPTED SOLUTION
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

 

Create 2 measures

 

Result1 =

var _a = FILTER(ALLEXCEPT('Table','Table'[Bank]), 'Table'[ErrorType] <> BLANK())

RETURN
CALCULATE(DISTINCTCOUNT('Table'[Process]),_a)
 
 
 
Result2 = CALCULATE(DISTINCTCOUNT('Table'[Process]),ALLEXCEPT('Table','Table'[Bank]))

 

 

1.jpg

 

 

 

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi,

 

I am also new to DAX. I was just wondering if we could use the following code for your 2nd requirement !

 

Table = SUMMARIZE(Sheet1,Sheet1[bank],"numb",DISTINCTCOUNT(Sheet1[process]))
 
Please let me know your inputs.
 
Thanks
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

 

Create 2 measures

 

Result1 =

var _a = FILTER(ALLEXCEPT('Table','Table'[Bank]), 'Table'[ErrorType] <> BLANK())

RETURN
CALCULATE(DISTINCTCOUNT('Table'[Process]),_a)
 
 
 
Result2 = CALCULATE(DISTINCTCOUNT('Table'[Process]),ALLEXCEPT('Table','Table'[Bank]))

 

 

1.jpg

 

 

 

 

Regards,
Harsh Nathani

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

Anonymous
Not applicable

Hi @Anonymous 

DAX does a good job of using the context of what's in a table to group things for you. The DAX for what you're looking for is pretty simple, we just need to write a formula that counts the unique processes with errors, and then another similar formula for calculating just the unique processes.

Distinct Processes with Errors =
CALCULATE(
DISTINCTCOUNT(process number),
NOT(ISBLANK(error type))
)

Distinct Processes = 
DISTINCTCOUNT(process number)
Anonymous
Not applicable

Hello,

the code bellow didn't work 😞

NOT(ISBLANK(error type))

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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