Forum Discussion

Rednut's avatar
Rednut
Regular Visitor
4 years ago

PowerBI - Slicer for multiple columns from excel

I'm trying to create a dashboard that has multiple answers for a slicer to filter on a single table of data from Excel.
for example;

 

Column A (person)Language - EnglishLanguaged - SpanishOccupation - PlumberOccupation - Librarian
JohnEnglishSpanishPlumber 
FredEnglish  Librarian
Bill SpanishPlumberLibrarian

 

I want to be able to set up a slicer that has English & Spanish as options in the slicer and will filter the table to show anyone who speaks english or spanish
IE: if you select 'english' it would show John & Fred but not Bill. If you select spanish, it shows John and Bill and not Fred.

 

I would like to have the above for multiple queries in the one dashboard. language(s), occupation(s), car(s) etc

 

end result being (if i selected the following): slicer 1: [spanish] slicer 2: [Plumber] and [Librarian] = Bill is left in the table

3 Replies

  • Rednut , Assume those values coming from an independent table

     

    You can this measure in slicer or visual level filter

     

    measure =

    var _1  =selectedvalue(Language[Language])

    var _2 = Switch(_1 ,

    "English", filter(Table, Table[Language - English] = "English") ,

    "Spanish", filter(Table, Table[Language - Spanish] = "Spanish")

    )

    return

    calculate(countrows(Table), _2)

     

    • Rednut's avatar
      Rednut
      Regular Visitor

      Thank you for the response. I receive the error "the expression refers to multiple columns. multiple columns cannot be converted to a scalar value". Does column B and C need to have the same title? (i cant have 'Language - English' as the title of column B and 'Language - Spanish' as the title for column C?)

  • Rednut's avatar
    Rednut
    Regular Visitor

    It's all in the one table currently as displayed above. Do i need to create additional tables and link them?

    I'm basically trying to get an 'And/Or' statement for 2 or more columns per slicer