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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Filter table based on multiple column values

Hi, I have list of projects and variuos business units (Cargo, Link, Infra). I need the slicer to be able to filter the projects table based on those column values. Here's what I have now:

Capture.JPG

 

For the slicer I created an extra table only with the list of business units and thought will go with a measure like this:

Selected Metric =
SWITCH(
TRUE(),
SELECTEDVALUE('BusinessUnit'[BU]) = "LINK", CALCULATE('Portfolio status', 'Portfolio status'[LINK]="Yes"),
SELECTEDVALUE('BusinessUnit'[BU]) = "CARGO", CALCULATE('Portfolio status', 'Portfolio status'[CARGO]="Yes"),
SELECTEDVALUE('BusinessUnit'[BU]) = "INFRA",CALCULATE('Portfolio status', 'Portfolio status'[INFRA]="Yes"))

 

But it does not work this way as getting "the expression refers to multiple columns. multiple columns cannot be converted to a scalar value". Could you advise on how I can get the desired result ?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , no measure selected in calculate. Used countrows for example

 

Selected Metric =
SWITCH(
TRUE(),
SELECTEDVALUE('BusinessUnit'[BU]) = "LINK", CALCULATE(countrows('Portfolio status'), 'Portfolio status'[LINK]="Yes"),
SELECTEDVALUE('BusinessUnit'[BU]) = "CARGO", CALCULATE(countrows('Portfolio status'), 'Portfolio status'[CARGO]="Yes"),
SELECTEDVALUE('BusinessUnit'[BU]) = "INFRA",CALCULATE(countrows('Portfolio status'), 'Portfolio status'[INFRA]="Yes")

)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , no measure selected in calculate. Used countrows for example

 

Selected Metric =
SWITCH(
TRUE(),
SELECTEDVALUE('BusinessUnit'[BU]) = "LINK", CALCULATE(countrows('Portfolio status'), 'Portfolio status'[LINK]="Yes"),
SELECTEDVALUE('BusinessUnit'[BU]) = "CARGO", CALCULATE(countrows('Portfolio status'), 'Portfolio status'[CARGO]="Yes"),
SELECTEDVALUE('BusinessUnit'[BU]) = "INFRA",CALCULATE(countrows('Portfolio status'), 'Portfolio status'[INFRA]="Yes")

)

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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