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 have sales data that includes columns:
I'd like to create a measure that calculates customer count (distinct) when customer have bought more than 3 products in a week. Also I'd like to visualize this measure with Card.
products per week = distinctcount(sales[product_id])/distinctcount(sales[week])
I created a table visualization that contains week, customer_id and products per week. I also can add filter to my visualization and filter products per week >=3. I can see from this table how many customer_ids match my filter. When I try to transform my visualization to Card I'll get total amount of customer_ids. Filter do not work.
I tried to create another measure.
customer count = calculate(distinctcount(sales[customer_id]);filter(sales;[products per week]>=3))
This one doesn't give any answer.
I think that my problem has something to do with the order of the calculations. Is there a way to manipulate this? Also is there anything wrong with my second measure and why it doesn't give any aswer?
I'll still try to google my problem and try to find aswer from this site aswell. But any advices will be most appreciated.
Solved! Go to Solution.
Answering to my own question...
I created a new column just to calculate how many products each customer has bought.
Products purchased = calculate(distinctcount(sales[product_id]);allexcept(sales;sales[customer_id]))/distinctcount(sales[week])
Customer count = calculate(distinctcount(sales[customer_id]);filter(sales;[Products purchased]>=3))
Everything works now!
Answering to my own question...
I created a new column just to calculate how many products each customer has bought.
Products purchased = calculate(distinctcount(sales[product_id]);allexcept(sales;sales[customer_id]))/distinctcount(sales[week])
Customer count = calculate(distinctcount(sales[customer_id]);filter(sales;[Products purchased]>=3))
Everything works now!
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 |
---|---|
108 | |
106 | |
87 | |
77 | |
69 |
User | Count |
---|---|
124 | |
112 | |
94 | |
84 | |
75 |