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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
Microsoft Employee
Microsoft 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
Microsoft Employee
Microsoft 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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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