Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Dipak_22
Frequent Visitor

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

Dipak_22_1-1713772015375.png

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"

Dipak_22_0-1713771916222.png

Can i get an idea how to resolve this ASAP

 

1 ACCEPTED SOLUTION

Hi @Dipak_22 ,

 

Please check that the following results meet your expectations:

vtianyichmsft_0-1713922979165.png

vtianyichmsft_1-1713922986190.png

 

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.

View solution in original post

4 REPLIES 4
v-tianyich-msft
Community Support
Community Support

Hi @Dipak_22 ,

 

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

vtianyichmsft_0-1713852038711.png

vtianyichmsft_1-1713852047904.png

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.

 

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

Hi @Dipak_22 ,

 

Please check that the following results meet your expectations:

vtianyichmsft_0-1713922979165.png

vtianyichmsft_1-1713922986190.png

 

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.

Ritaf1983
Super User
Super User

Hi @Dipak_22 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.