Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
Request your help to create DAX for Distinct count of IDs against each Name rows in table.
(desired result shown in last colunms)
Name | ID NO. | DAX for Desired Result (Distinct ID against Name) |
Rohan | AA | 2 |
Rohan | BB | 2 |
Rohan | AA | 2 |
Mira | BB | 2 |
John | AA | 1 |
Mira | CC | 2 |
Celvin | AA | 1 |
James | AA | 1 |
Celvin | AA | 1 |
Thanks in advance..
Solved! Go to Solution.
@MEHUL123 Try this. PBIX is attached below signature.
Distinct Count =
VAR __Name = MAX( 'Table'[Name] )
VAR __Table = FILTER( ALLSELECTED( 'Table' ), 'Table'[Name] = __Name )
VAR __Group = SUMMARIZE( __Table, [Name], [ID] )
VAR __Result = COUNTROWS( __Group )
RETURN
__Result
DAX measure:
Distinct ID Count =
CALCULATE(
DISTINCTCOUNT(Table[ID NO.]),
ALLEXCEPT(Table, Table[Name])
)
This will give you the distinct count of ID NO. for each Name.
If this helped, a Kudos 👍 or Solution mark would be great!🎉
Cheers,
Kedar Pande
Connect on LinkedIn
@MEHUL123 Try this. PBIX is attached below signature.
Distinct Count =
VAR __Name = MAX( 'Table'[Name] )
VAR __Table = FILTER( ALLSELECTED( 'Table' ), 'Table'[Name] = __Name )
VAR __Group = SUMMARIZE( __Table, [Name], [ID] )
VAR __Result = COUNTROWS( __Group )
RETURN
__Result
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
8 | |
8 | |
7 |
User | Count |
---|---|
14 | |
12 | |
11 | |
10 | |
9 |