Forum Discussion

Dipak_22's avatar
Dipak_22
Frequent Visitor
2 years ago
Solved

Create a slicer based on the dynamic conditional filter

Hi Everyone i am facing a roadblock with the power bi slicer

There's a "Scope" Named column in the table which is added in power bi for report creation. This Columns Contains following information or variables:
1.Never Protected
2.No Longer Protected
3.Protected
4.Protection Not Covered
5.Protection Under Investigation
6.Protection Unknown
I want to Create a column using measures which will contain two Filter option which is mentioned below:
"Incl. patent-protected products"
"Excl. patent-protected products"

 

this is the sample Data

NameScopePrice
Aprotected254
BNever Protected175
CNo Longer Protected295
DProtection Unknown355
Eprotected450
FProtection Not Covered210
GProtection Under Investigation152

this is how the variable looks into the normal slicer in power bi

and I am expecting a result like below:

so the Incl. patent-protected products should contains all the values or variables from Scope column and Excl. patent-protected products should contains all the variables except "Protected"

Can i get an idea how to resolve this ASAP

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Dipak_22 ,

     

    Please check that the following results meet your expectations:

     

    An attachment for your reference. Hope it helps!

     

    Best regards,
    Community Support Team_ Scott Chang

     

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Dipak_22 ,

     

    I made simple samples and you can check the results as follows

    Group = var _s = [Scope]
    RETURN SWITCH(TRUE(),
    _s="Never Protected","Excl. patent-protected products",
    _s="No Longer Protected","Excl. patent-protected products",
    _s="Protection Not Covered","Excl. patent-protected products",
    "Incl. patent-protected products")

     

    An attachment for your reference. Hope it helps!

     

    Best regards,
    Community Support Team_ Scott Chang

     

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

     

    • Dipak_22's avatar
      Dipak_22
      Frequent Visitor

      Hi Thanks for trying but this is not the solution i am looking for let me rephrase the expecting result as per the pbix you provided
      so if under the Incl. patent-protected products have protected, protection unknown and protection under investigation 

      NameScopeSum of Price Group
      AProtected254Incl. patent-protected products
      Dprotection unknown355 Incl. patent-protected products
      EProtected450 Incl. patent-protected products
      Gprotection under investigation152 Incl. patent-protected products

       then under Excl. patent-protected products should have protection unknown and protection under investigation but not protected like this 

      NameScopeSum of priceGroup
      Bprotection under investigation175Excl. patent-protected products
      Cprotection unknown295Excl. patent-protected products
      Fprotection unknown210Excl. patent-protected products

      please do let me know if this could be possible using something like parameters

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Dipak_22 ,

         

        Please check that the following results meet your expectations:

         

        An attachment for your reference. Hope it helps!

         

        Best regards,
        Community Support Team_ Scott Chang

         

        If this post helps then please consider Accept it as the solution to help the other members find it more quickly.