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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
bergen288
Helper III
Helper III

how to create a slicer with values from multiple columns?

Below is an example of my table visual with Name1, Name2, Name3 columns.  I would like to create a slicer with values from all 3 columns so that I can select particular name such as "C" no matter which column has it.  That is, the target slicer value "C" should select 1,3,4,7,8 rows.  How to do it?

bergen288_0-1680553579455.png

 

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

you need to create a new table

Screen Capture #799.png

View solution in original post

2 REPLIES 2
bergen288
Helper III
Helper III

Here is how to make it work, partially.  Below is my DAX to create new slicertable: 

SlicerTable =
DISTINCT (
    UNION (
        VALUES ( Table1[Name1] ),
        VALUES ( Table1[Name2] ),
        VALUES ( Table1[Name3] )
    )
)
Next is a measure:
Name =
IF (
    SELECTEDVALUE( 'Table1'[Name1] ) IN VALUES ( SlicerTable[Key] )
        || SELECTEDVALUE( 'Table1'[Name2] ) IN VALUES ( SlicerTable[Key] )
        || SELECTEDVALUE( 'Table1'[Name3] ) IN VALUES ( SlicerTable[Key] ),
    SELECTEDVALUE(SlicerTable[Key]),
    BLANK ()
)
 The last step is to create slicer by slicertable[Name], and add 'Name' mesure into target table visual.  It gives me correct answer when "C" is selected.
bergen288_1-1680636228048.png

However, it gives me nothing when "All" is selected or nothing is selected.  My 'Name' measure is copied and modified from someone.  I believe the BLANK function is the root cause.  How to fix it?

bergen288_2-1680636313403.png

 

 


 

 
 
Ahmedx
Super User
Super User

you need to create a new table

Screen Capture #799.png

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

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.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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