Count of distinct values by ID based on another table
I have two tables: Sales and Store tables. Both have multiple columns and they are related by the "StoreID" column.
Below you can see a sample of that.
I want to create a new column in the Store table with the number of products by store, based on Sales table. The "ProductID" column can have nulls and duplicate values, so I think the most suitable count is distinctcount.