March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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]))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
122 | |
89 | |
78 | |
67 | |
52 |
User | Count |
---|---|
199 | |
140 | |
96 | |
77 | |
68 |