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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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")

)

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")

)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors