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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vidyasagar159
Helper II
Helper II

Identify how many companies have multiple company ID's using DAX?

Hi All,

 

Hope you are doing great. I want to identify how many companies have multiple company ID's using DAX?

I don't want to do it on transformation using group by because its if failing and getting some error.

 

Find the sample data below.

 

Company IDCompanies
1Apple
2Apple
3Samsung
4Nokia
5Motorolla
6One Plus
7One Plus

 

Expected Output:

 

Count of Company ID'sCompanies
2Apple
1Samsung
1Nokia
1Motorolla
2

One Plus

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Drag Companies to the Table visual and drag this measure to the value area section

 

=DISTINCTCOUNT(Data[Company ID])

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

 

Drag Companies to the Table visual and drag this measure to the value area section

 

=DISTINCTCOUNT(Data[Company ID])

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

This is really helpful.

 

Alos in order to identify only companies which has more than 2 ID's all I did is in the visual filters i have changed the count of Company ID >1 and that worked perfect.

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
MariaP
Solution Supplier
Solution Supplier

Hi vidyasagar159

 

Try this measure:

 

No Of Company IDs = 
var NumberOfIds  = COUNTAX( Company, Company[Company])
RETURN 
NumberOfIds

 And a further:

 

 

DoesCompanyHaveMultiple = IF ([No Of Company IDs] > 1 , "Yes" , "No" )

MultipleCompanyID.PNG

 

Cheers,
Maria

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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