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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.