Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
3 years ago

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.

YearMyPoint of salesales PRODUCT Asales PRODUCT B
2022Septemberplace 1199
2022Septemberplace 2 3
2022Septemberplace 343
2022Septemberplace 41831
2022Septemberplace 556
2022Septemberplace 631
2022Septemberplace 7 7
2022Septemberplace 8531

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

  • AbbasG's avatar
    AbbasG
    Memorable Member
    Syndicate_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-xiaotang's avatar
    v-xiaotang
    Community Support

    Hi Syndicate_Admin 

    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.