Forum Discussion
Syndicate_Admin
3 years agoAdministrator
Group Intersection
Hello everyone.
I am a little new to Power BI, I am doing a project that consists of how is the coexistence of two brands in different points of sale.
| Year | My | Point of sale | sales PRODUCT A | sales PRODUCT B |
| 2022 | September | place 1 | 19 | 9 |
| 2022 | September | place 2 | 3 | |
| 2022 | September | place 3 | 43 | |
| 2022 | September | place 4 | 18 | 31 |
| 2022 | September | place 5 | 5 | 6 |
| 2022 | September | place 6 | 31 | |
| 2022 | September | place 7 | 7 | |
| 2022 | September | place 8 | 5 | 31 |
I have to define how many points of sale sell product A, how many sell product B and how many sell both.
Getting the quantity of each product was very simple:
Number of Places Selling A =
CALCULATE([Total Places] , Sales[VolTotal] > 0, Product = "Product A")
Number of Places Selling B =
CALCULATE([Total Places] , Sales[VolTotal] > 0, Product = "Product B")
I understand that to find the place where both are sold I would have to make an intersection of both, but I can not find a way.
I would appreciate your help.
2 Replies
- AbbasGMemorable MemberSyndicate_Admin The below DAX will help in getting the desired outcome.
Selling places for both products =CALCULATE([Count places],'Table (2)'[sales PRODUCT A], 'Table (2)'[sales PRODUCT B])Also, there are better ways of achieving this one of them is creating a variable and then returning them. Instead of creating 3 different measures. Hope it helps.
- v-xiaotangCommunity Support
could you share some sample data in table 'Sales'? thanks
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.