Hi,
imagine that you have 3 tables:
Table Fact Seller : seller_code, seller_name, manager_code
Table Fact Manager : manager_code, manager_name
Table Fact Product : product_code, product_name, seller_code
Relations have been made between keys
I want to calculate two aspects:
1) The number of active sellers. A Seller is active if it has any (1 or more) product in Fact Product.
i would like to know how i can i calculate this. it would be something like
=CALCULATE(DISTINCTCOUNT('Fact Seller'[seller_code]);[filter here]))
In [filter here] i need something like FILTER(COUNTROWS('Fact Product';'Fact Product'[manager_code])>=1), to get only the sellers from fact seller who have at least one product in fact product. I think i need to use the keyword VALUES() but i didn't find the correct syntax.
i would like to know what is better way or pattern for doing this.
2) The number of sellers with managers. Please note that when data is retrieved, if a seller has no manager the field manager_code has value "-1". So i can do this:
=CALCULATE(DISTINCTCOUNT('Fact Seller'[seller_code]);FILTER('Fact Seller';'Fact Seller'[manager_code]>=1))
So this is a filter inside the table. This works, but i would like to know if there is a better way or pattern for this.
Can you help out ?
kind regards
imagine that you have 3 tables:
Table Fact Seller : seller_code, seller_name, manager_code
Table Fact Manager : manager_code, manager_name
Table Fact Product : product_code, product_name, seller_code
Relations have been made between keys
I want to calculate two aspects:
1) The number of active sellers. A Seller is active if it has any (1 or more) product in Fact Product.
i would like to know how i can i calculate this. it would be something like
=CALCULATE(DISTINCTCOUNT('Fact Seller'[seller_code]);[filter here]))
In [filter here] i need something like FILTER(COUNTROWS('Fact Product';'Fact Product'[manager_code])>=1), to get only the sellers from fact seller who have at least one product in fact product. I think i need to use the keyword VALUES() but i didn't find the correct syntax.
i would like to know what is better way or pattern for doing this.
2) The number of sellers with managers. Please note that when data is retrieved, if a seller has no manager the field manager_code has value "-1". So i can do this:
=CALCULATE(DISTINCTCOUNT('Fact Seller'[seller_code]);FILTER('Fact Seller';'Fact Seller'[manager_code]>=1))
So this is a filter inside the table. This works, but i would like to know if there is a better way or pattern for this.
Can you help out ?
kind regards