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
asaemart
Frequent Visitor

Exclude Filter

Hello,

 

We are trying to reproduce the following scenario with no sucess:

 

  • We have imported some data from SQLServer. Specifically one table with 5 columns ("Table1"), being one of them a flag (binary or bit, let's say it is called "flag0/flag1").
  • We have one visualization (table visualization) in which the information of Table1 is showed (except the "flag0/flag1" column).
  • We would like to have another visualization (slicer/check box filter) in which we use the "flag0/flag1" flag column:
    • There is just one box in the slicer ("let's say it is called "flag1") 
    • If the box is not selected, we would like to filter the Table1 for flag0. So as soon as we run the report, the filter is applied.
    • If the box is selected, we would like to filter the Table1 for flag1.

 

Thank you in advance and regards,

 

Adri.

1 ACCEPTED SOLUTION
v-huizhn-msft
Employee
Employee

Hi @asaemart,

I try to reproduce your scenario by my sample table below.

1.PNG

I create a new table including flag1 by clicking "New Table" under Modeling on Home page.

2.PNG

Create two measures using the following formula.

ISSELECTED = IF(ISFILTERED(Table3[flag]), VALUES(Table3[flag]),BLANK())

Sales-new = IF(ISBLANK(Table3[ISSELECTED]),CALCULATE(SUM(Table2[sales]),FILTER(Table2,Table2[flag]="flag0")),CALCULATE(SUM(Table2[sales]),FILTER(Table2,Table2[flag]="flag1")))


Create a slicer including flag1, create a table visual shows the information, set the visual filter as the highlighted red line.

3.png

Please see the expected result. I shows the flag in table visual, so that you can see it directly. When we not select "flag1" it display all information for "flag0", otherwise, we select "flag0" it display all information for "flag1".

4.PNG5.PNG

Please download the attachments to test.

Thanks,
Angelia

 

View solution in original post

1 REPLY 1
v-huizhn-msft
Employee
Employee

Hi @asaemart,

I try to reproduce your scenario by my sample table below.

1.PNG

I create a new table including flag1 by clicking "New Table" under Modeling on Home page.

2.PNG

Create two measures using the following formula.

ISSELECTED = IF(ISFILTERED(Table3[flag]), VALUES(Table3[flag]),BLANK())

Sales-new = IF(ISBLANK(Table3[ISSELECTED]),CALCULATE(SUM(Table2[sales]),FILTER(Table2,Table2[flag]="flag0")),CALCULATE(SUM(Table2[sales]),FILTER(Table2,Table2[flag]="flag1")))


Create a slicer including flag1, create a table visual shows the information, set the visual filter as the highlighted red line.

3.png

Please see the expected result. I shows the flag in table visual, so that you can see it directly. When we not select "flag1" it display all information for "flag0", otherwise, we select "flag0" it display all information for "flag1".

4.PNG5.PNG

Please download the attachments to test.

Thanks,
Angelia

 

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.