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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
BeardedDog888
Regular Visitor

Conditional filtering based on existing conditions

Screenshot_20221203-075704_Bixby Voice.jpg

I have a table (table1) in a matrix visual that is linked to a second table (table2). Table2 has a category column (x) where each row is labelled as either 1 or 0. I want a separate visual (y) to be filtered based on both current filtering on page but also by an additional condition: if both x=1 and x=0 rows are visible in table1 matrix visual then filter out all values where x=1 else show all values. Please note that column x itself does not appear in the table1 matrix visual I've just included these in the examples to illustrate the issue.

 

I have tried creating a measure for this but it only works when a selection is made on the table1 visual. I would like help to be able to have a filter which works both when data is selected on the matrix visual and when nothing is selected.

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @BeardedDog888 ,

 

Here are the steps you can follow:

1. Create calculated table.

Company =
DISTINCT('Table'[Company])

vyangliumsft_0-1670229462500.png

2. Create measure.

Flag =
 IF(COUNTROWS(ALL('Table'))=COUNTROWS(ALLSELECTED('Table')),0,1)

3. Place [Flag] in the Filter of the Company Table to 1.

vyangliumsft_1-1670229462504.png

4. Place the [Company] of the Table in the Filters on this page.

vyangliumsft_2-1670229462509.png

5. Result:

When there are 1 and 0, it is not displayed

vyangliumsft_3-1670229462510.png

When there is only 1, display all

vyangliumsft_4-1670229462510.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

Unfortunately this doesn't solve the issue as I still need to display visual when both 0 and 1 values are in the table, it is just that when this occurs only 0 values should show in the visual.

lbendlin
Super User
Super User

Read about ISFILTERED()

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Power BI Header Change

Power BI Header Update

Read about the exciting updates for the Power BI forum.

Top Solution Authors