Forum Discussion
Distinct count from another table (i think)
Hi
First post so go easy :)
I have created a model which has a sales table, customer table and product table.
I'm trying to create a card in BI Desktop which, when filtered by product range, shows me the number (distinct count) of stores the range is sold in.
I have created a measure in my sales table.....
Sales CY Stores =
CALCULATE (
DISTINCTCOUNT (Customers[Store Name]),
'Sales - Current Year'[SalesValue]
)
...but the result is i always get the total number of stores (251) in my customer table regardless of the filters. e.g. product range 1 should show 30 stores.
Can anyone help?
Thanks
3 Replies
- BhaveshPatelSuper User
Need to look at your data model and are they all connected by relationships.
What are the primary and foreign keys in each table.
what exactly you are trying to do.
Please provide me the answer of this question or the sample data file, more than happy to look into your problem.
- Eric_ZhangMicrosoft Employee
...but the result is i always get the total number of stores (251) in my customer table regardless of the filters. e.g. product range 1 should show 30 stores.
Most probably there's no relationship between customer and product table. If a Many:Many relationship, please reference the attached pbix.
- AnonymousNot applicable
Sales CY Stores =
CALCULATE (
DISTINCTCOUNT (Customers[Store Name]),
'Sales - Current Year'[SalesValue]
)This doesn't even look "legal" to me... what is that param!?