Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I want to add a column that counts the number of items that has the foreign ID in one of the corresponding row ID in another table using Power Query Editor and a formula. The formula I improvised is: List.Count(List.Select([Device.ID],[Device.ZoneID]=[ID]))
It just throws out an error as I expected since the Device.ID and Device.ZoneID columns aren't found. How do I accomplish this?
Solved! Go to Solution.
Thanks for the data. That makes it much easier.
I'd probably tackle it with a merge.
See attached PBIX file.
Let me know if you have questions.
| Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). | 
Thanks for the data. That makes it much easier.
I'd probably tackle it with a merge.
See attached PBIX file.
Let me know if you have questions.
| Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). | 
Any chance you could paste the data in a table instead of screenshots?
| Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). | 
Device
| ID | Device Name | Category ID | Zone ID | Status | Is Active | Date Installe | 
| D01 | Front-door Camera | Camera | Terrazzo | Active | TRUE | 1/25/2020 | 
| D02 | Boiler Temp | Temperature Sensor | Boilermaker Room | Inactive | TRUE | 2/2/2021 | 
| D03 | Speed Testing | Speed Sensor | Safety Office | Active | TRUE | 12/11/2021 | 
| D04 | Entry Access | Access Control | Stucco Mason Building | Active | TRUE | 3/21/2022 | 
| D05 | Exit Access | Access Control | Stucco Mason Building | Inactive | FALSE | 3/21/2022 | 
| D06 | Light Activation | Motion Sensor | Labor Office | Inactive | FALSE | 5/17/2021 | 
| D07 | Front-door Camera | Camera | Environmental Office | Active | TRUE | 8/1/2021 | 
| D08 | Aircon Activation | Motion Sensor | Tile Setting Bench | Inactive | FALSE | 8/26/2021 | 
| D09 | Assembly Temp | Temperature Sensor | Linemen Assembly | Inactive | FALSE | 1/23/2022 | 
Zone
| ID | ZoneName | ZoneDescription | 
| Z01 | Terrazzo | 13-175 - Ice Rinks | 
| Z02 | Boilermaker Room | 2-870 - Sculpture/Ornamental | 
| Z03 | Safety Office | 17-030 - Bond | 
| Z04 | Stucco Mason Building | 2-750 - Concrete Pads and Walks | 
| Z05 | Iron Workshop | 3-400 - Precast Concrete | 
| Z06 | Labor Office | 1-523 - Sanitary Facilities | 
| Z07 | Environmental Office | 2-370 - Erosion and Sedimentation Control | 
| Z08 | Tile Setting Bench | 1-570 - Temporary Controls | 
| Z09 | Linemen Assembly | 2-825 - Wood Fences and Gates | 
Can you please provide some sample (mock-up) data from each of the two tables?
It'll be much easier to help with something to work with.
| Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). | 
I made a new query/function that seems to better express what I want to do (Device Count)
Device
Zone
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 85 | |
| 49 | |
| 36 | |
| 31 | |
| 30 |