Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm trying to get a list of products that were sold to a single customer. I can easily attain an accurate list of products with a COUNT function by Customer that is filtered to "1". However, once I bring in customer detail, the list blows up. Any advice?
Solved! Go to Solution.
This link solved my problem:
The function I used:
CUSTOMER_COUNT_BY_PRODUCT = CALCULATE(DISTINCTCOUNT(VIEW_SALES[CUSTOMER_CODE_SOLD]), ALLEXCEPT(VIEW_SALES, VIEW_SALES[MFC_PRODUCT_CODE],VIEW_SALES[TRANSACTION_DATE]))
Adding in the Customer changes the context. The table now shows a count of products where a customer has bought one (per customer).
This is how measures work, they adapt to the context in which they are evaluated.
You have options: re-write the measure to alter the context back to the original
or (depending on your model) put the customer in a separate visualisation (rather than add it to the table) and click the rows of the table.
Post your pbix here if you want someone to look at it
This link solved my problem:
The function I used:
CUSTOMER_COUNT_BY_PRODUCT = CALCULATE(DISTINCTCOUNT(VIEW_SALES[CUSTOMER_CODE_SOLD]), ALLEXCEPT(VIEW_SALES, VIEW_SALES[MFC_PRODUCT_CODE],VIEW_SALES[TRANSACTION_DATE]))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
99 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |