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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Create measure giving distinct count of account numbers grouped by branch

DateBranch IDAccount Number
9/29/20211525A
10/3/20211525A
9/30/20211525B
9/28/20211525C

10/1/2021

2010D

10/2/2021

2010E

9/9/2021

3009X

9/11/2021

3009X

 

This has been evading me all day. I have a table that looks like the one above, and I want to create a measure that gives me the distinct count of account numbers for the branch (which I just labelled as letters here). Essentially, I want to group by Branch ID and count the distinct values within that group using DAX. The output of the measure should take the values in the table below (but I don't want an actual table, I just want to have the measure give me the numbers in the output when I am looking at a specific branch).

 

Branch IDOutput
15253
20102
30091

 

I have been struggling with this all day and am looking forward to getting an answer on this.

3 REPLIES 3
AlexisOlson
Super User
Super User

Where do you want to use your measure if not in "an actual table"? What does the final result you're trying to get to look like?

PaulOlding
Solution Sage
Solution Sage

Hi @Anonymous 

Not sure i've fully understood what you want but a measure to count the number of account numbers would give this result.

Accounts count = DISTINCTCOUNT('Table'[Account Number])

 

PaulOlding_0-1635586421921.png

 

mahoneypat
Microsoft Employee
Microsoft Employee

What do you mean you don't want to output table?  You can create that summary table as a variable in a measure, but you will then need to create some scaler value (sum of distinct counts, concatenation of the rows as text, etc.).  What is your final desired output?

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.