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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Kerslaing
Helper I
Helper I

Slicer with Column Heading but filter based on that column data having Yes/No

Hi,  I need to create a slicer for our software level category  that uses the level as the slicer but filters if that software has YES in the column that has been selected in the slicer.

 

The data looks likes this

Titlelevel1level2level3
software1YESYES 
software2YES  
software3 YESYES

 

i have created a slicer showing level1, level2 ,level3,  but cannot work out how to filter the data so that when level1 is selected  only software 1 and software 2 show, if level3 is selected then software3 should show etc

 

Any help appreciated

 

 

 

 

1 ACCEPTED SOLUTION

HI @Kerslaing,

In fact, power bi does not suitable for directly applying filters across multiple fields.
In my opinion, I'd suggest you do 'unpivot columns' on the level fields on the query editor, then you can use the raw table category and the attribute field to create a matrix.

Unpivot columns - Power Query | Microsoft Docs
After these steps, you can use unpivoted attribute and value fields as conditions to accurately filter these records.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
Kerslaing
Helper I
Helper I

I cant get that to work,  just keep getting incorrect syntax on the measure  at the return/last bracket on the switch.  But it did point me to another solution.   

 

IF(AND(SELECTEDVALUE('Level Slicer'[Level])="Level1",min('Table'[Level1])="YES")||
AND(SELECTEDVALUE('Level Slicer'[Level])="Level2", min(''Table'[Level2])="YES")||
AND(SELECTEDVALUE('Level Slicer'[Level])="Level3",min(''Table'[Level3])="YES")||
AND(SELECTEDVALUE('Level Slicer'[Level])="Level4",min(''Table'[Level4])="YES"),
1, 0 )
 
 
 

HI @Kerslaing,

In fact, power bi does not suitable for directly applying filters across multiple fields.
In my opinion, I'd suggest you do 'unpivot columns' on the level fields on the query editor, then you can use the raw table category and the attribute field to create a matrix.

Unpivot columns - Power Query | Microsoft Docs
After these steps, you can use unpivoted attribute and value fields as conditions to accurately filter these records.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@Kerslaing , Create different Filter for that

 

Measure =

var _fil = Switch(selectedvalues(Level[Level]) ,

"Level1", filter(Table, Table[Level1]="Yes"),

"Level3", filter(Table, Table[Level2]="Yes"),

"Level4", filter(Table, Table[Level3]="Yes") )

return

countrows(_fil)

 

Use this with title in the visual

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.