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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.