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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

A slicer for multiple columns

I am working on a project and I would like a slicer to search all columns within the table. Below is an example:

 

NamesVote 1Vote 2Vote 3Vote 4Vote 5Vote 6Vote 7Vote 8Vote 9Vote 10
JackConnorSianPaulLukeSianJimmyConnorJimmyPaulHarry
HarryJackLukeJackConnorJamesConnorLukeJamesHarryLuke
GaryJimmyBeckyJamesJamesJamesJimmyHarryJamesJamesSean
LukeHarryJamesGaryRichardLukeJamesGarySeanSeanLuke
JamesBeckyPaulHarryHarryJamesConnorJamesConnorJamesBecky
RichardHarryJackSeanRichardSeanJamesConnorPaulLukeLuke
ConnorHarryBeckyBeckySianRichardHarryJamesJimmyGaryLuke
SianLukeSeanHarryJackBeckyJackGaryGaryJamesSian
LukeJackSeanRichardConnorLukeLukeHarryBeckyJackLuke
HannahPaulPaulHarryRichardSianSianHarrySianPaulBecky
JimmyLukeSianJamesSeanBeckyLukeLukeLukeHarryLuke
SeanJackSianLukeRichardRichardJimmyConnorSianJackHarry
PaulJamesRichardGaryJackHarryGaryLeahHarryJackGary
BeckyJamesHarryRichardLeahJimmyConnorLukeConnorRichardHarry
LeahRichardHarryConnorConnorJackHarryHarryHarryJackGary

 

I would like to use the column "Names" for the slicer. Therefore, when I clicked a name it would display all the people that voted for them in a table. For example, if I clicked the name Jack it would display the following:

 

NamesVote 1Vote 2Vote 3Vote 4Vote 5Vote 6Vote 9
HarryJackLukeJackConnorJamesConnorHarry
RichardHarryJackSeanRichardSeanJamesLuke
SianLukeSeanHarryJackBeckyJackJames
LukeJackSeanRichardConnorLukeLukeJack
SeanJackSianLukeRichardRichardJimmyJack
PaulJamesRichardGaryJackHarryGaryJack
LeahRichardHarryConnorConnorJackHarryJack

 

It can be seen that Harry, Richard, Sian, Luke, Sean, Paul and Leah all voted for Jack within their 10 votes.

 

Currenly if I click Jack it just shows me what he has voted for his 10 votes.

 

Is the possible? Any help is much appreciated.

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

d1.png

 

Names(a calculated table):

Names = DISTINCT('Table'[Names])

 

You may create a measure as below.

Visual control = 
var tab = {MAX('Table'[Vote 1]),MAX('Table'[Vote 2]),MAX('Table'[Vote 3]),MAX('Table'[Vote 4]),MAX('Table'[Vote 5]),MAX('Table'[Vote 6]),MAX('Table'[Vote 7]),MAX('Table'[Vote 8]),MAX('Table'[Vote 9]),MAX('Table'[Vote 10])}
var result = 
COUNTROWS(
    FILTER(
        DISTINCT(Names[Names]),
        COUNTROWS(
            FILTER(
                tab,
                [Value]=[Names]
            )
        )>0
    )
)+0
return
IF(
    result>0,
    1,0
)

 

Then you need to put the measure in the visual level filter to filter the result.

d2.png

 

Best Regards

Allan

 

If this post helps,then consider Accepting it as the solution to help other members find it faster.

View solution in original post

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

d1.png

 

Names(a calculated table):

Names = DISTINCT('Table'[Names])

 

You may create a measure as below.

Visual control = 
var tab = {MAX('Table'[Vote 1]),MAX('Table'[Vote 2]),MAX('Table'[Vote 3]),MAX('Table'[Vote 4]),MAX('Table'[Vote 5]),MAX('Table'[Vote 6]),MAX('Table'[Vote 7]),MAX('Table'[Vote 8]),MAX('Table'[Vote 9]),MAX('Table'[Vote 10])}
var result = 
COUNTROWS(
    FILTER(
        DISTINCT(Names[Names]),
        COUNTROWS(
            FILTER(
                tab,
                [Value]=[Names]
            )
        )>0
    )
)+0
return
IF(
    result>0,
    1,0
)

 

Then you need to put the measure in the visual level filter to filter the result.

d2.png

 

Best Regards

Allan

 

If this post helps,then consider Accepting it as the solution to help other members find it faster.

Anonymous
Not applicable

you need another table

SELECT vote1 as filterName, name

Union

SELECT vote2, name

Union

SELECT vote3, name

......

Etc

 

Then make a relation between the new table and the current based on name

 

Make a filter on the field FilterName

Anonymous
Not applicable

Thank you for the reply but SELECT doesn't seem to be an expression when I am creating another table. The code doesn't seem to work.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.