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

How to combine Distinctcount and relatedtable?


zhrhr_0-1608104287287.png

 

DA_FACT_DMS is a table name. And I have a column in this table named "Well_Name". How do I write a DAX to calculate count distinct of Well_Name? 

 

Note:- I'm creating this DAX in another table. That's why I'm doing it like this.

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

If the two tables are related, try this:

Column =
CALCULATE ( DISTINCTCOUNT ( DA_FACT_DMS[Well_Name] ) )

column.JPG

 

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@Icey  what if I want to display all the well name? I don't want to count it. I've tried RELATED(DA_FACT_DMS[Well_Name])  but its not working 

Its the same case. I want to put the well_name column in another table. Both table are already connected.

Icey
Community Support
Community Support

Hi @Anonymous ,

 

Try this:

Column 2 =
CONCATENATEX ( RELATEDTABLE ( DA_FACT_DMS ), [Well_Name], ", " )

wellname.JPG

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

Icey
Community Support
Community Support

Hi @Anonymous ,

 

If the two tables are related, try this:

Column =
CALCULATE ( DISTINCTCOUNT ( DA_FACT_DMS[Well_Name] ) )

column.JPG

 

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

amitchandak
Super User
Super User

@Anonymous , what is other table and how they are related

distinctcount(DA_FACT_DMS[Well_Name])

or

countx(values(DA_FACT_DMS[Well_Name]),DA_FACT_DMS[Well_Name])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors