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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JuanDtM23
Helper II
Helper II

Count values from one table in another table

Good afternoon

I have a reference table called "SERVICIOS_TRAZADORES" which looks like this:

JuanDtM23_0-1600543242906.png

Additionally I have a table called "Services Enabled" has the following form:

JuanDtM23_2-1600544507906.png

As noted, tables can be related using service code.

My intention is to calculate a measure that tells me the number of tracer services enabled.

That is, count in the "Services Enabled" table how many plotter services exist.

Any ideas?

Thanks in advance.

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

Are Tracer Services columns, such as outpatient, hospitable, etc.?

If so, I suggest you test a UNPIVOT of the data in Power Query, so click Transform Data on the Home tab to open Power Query.

Select all columns related to plotter services, and then select the Transform > Explode Only Selected Columns tab.

Change attribute name > Plotter service type, Filter value only for "Yes". Delete the Value column.

Now you can Close and Apply and create relationship 1 to many in your code and counting should be easy. Simply place the new plotter service in values such as a different count or count if you prefer.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

1 REPLY 1
AllisonKennedy
Super User
Super User

Are Tracer Services columns, such as outpatient, hospitable, etc.?

If so, I suggest you test a UNPIVOT of the data in Power Query, so click Transform Data on the Home tab to open Power Query.

Select all columns related to plotter services, and then select the Transform > Explode Only Selected Columns tab.

Change attribute name > Plotter service type, Filter value only for "Yes". Delete the Value column.

Now you can Close and Apply and create relationship 1 to many in your code and counting should be easy. Simply place the new plotter service in values such as a different count or count if you prefer.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.