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

Column Displayed in a table Based on Slicer Selection

Hi,

 

This may be a really silly question, but I am trying to use a slicer value to filter a table.

 

In the following example 

 

OptionSelected = SELECTEDVALUE(YesNo[Answer]) which can be yes or no
 
Table =
Var Option = 'BI Measure'[OptionSelected]
RETURN
IF (Option = "Yes",
FILTER(Merchants_Parent,Merchants_Parent[MerchantStatus] <> ""),
FILTER(Merchants_Parent,Merchants_Parent[MerchantStatus] <>"Closed")
)
 
What I want is to create a table with or withioiut closed Merchants in, I keep getting "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."
 
Any help would be appreciated
1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

In Power BI, it doesn't support to filter a table based on a filter.

The physical table is static.

You could work with a workaround as below.

Create measure, add columns from the Merchants_Parent table in a "Table" visual, then add this measure in the visual level filter f the table visual.

Table = 
Var Option = [OptionSelected]
RETURN
IF (Option = "Yes",
CALCULATE(COUNTROWS(Merchants_Parent),FILTER(Merchants_Parent,Merchants_Parent[MerchantStatus] <> "")),
CALCULATE(COUNTROWS(Merchants_Parent),FILTER(Merchants_Parent,Merchants_Parent[MerchantStatus] <>"Closed"))
)

3.png

 

Best Regards

Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

In Power BI, it doesn't support to filter a table based on a filter.

The physical table is static.

You could work with a workaround as below.

Create measure, add columns from the Merchants_Parent table in a "Table" visual, then add this measure in the visual level filter f the table visual.

Table = 
Var Option = [OptionSelected]
RETURN
IF (Option = "Yes",
CALCULATE(COUNTROWS(Merchants_Parent),FILTER(Merchants_Parent,Merchants_Parent[MerchantStatus] <> "")),
CALCULATE(COUNTROWS(Merchants_Parent),FILTER(Merchants_Parent,Merchants_Parent[MerchantStatus] <>"Closed"))
)

3.png

 

Best Regards

Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you this is great 🙂

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.