Forum Discussion

crystalLearn's avatar
crystalLearn
Regular Visitor
4 years ago
Solved

Common item based on the dynamics selection

Hello all, could you pls help. I have tried so long without success, even after I saw a similar case in this forum. Anonymous  maybe you could explain your idea agin, if it looks the same to you... ...
  • parry2k's avatar
    4 years ago

    crystalLearn solution sent you by an email, here is the core measure:

     

    Common Items = 
    VAR __itemsWithDistinctSupplier = 
    SUMMARIZE ( 
        ALLSELECTED ( Sheet1 ), 
        Sheet1[item], 
        "@C", DISTINCTCOUNT ( Sheet1[supplier] ) 
    )
    VAR __selectedSupplier = 
        CALCULATE ( 
            DISTINCTCOUNT ( Sheet1[supplier] ), 
            ALLSELECTED ( ) 
        )
    VAR __itemsFilter = FILTER ( __itemsWithDistinctSupplier, [@C] = __selectedSupplier )
    RETURN 
    CALCULATE ( 
        COUNTROWS ( Sheet1 ), 
        KEEPFILTERS ( __itemsFilter ) 
    )

     

     

    Follow us on LinkedIn and  to our YouTube channel

     

    Learn about conditional formatting at Microsoft Reactor

    My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.