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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
jdusek92
Advocate III
Advocate III

Filtering between 2 views - with a shared subset of rows

Hello,

I have this scenario: I have this data table loaded in PBI:

2019-05-31 22_54_59-Untitled - Power Query Editor.png

I want to be able to switch between view Y (rows 1-9) and view X (rows 4-12) by selecting the view I want with a slicer/filter - NOT by deselecting the subset of rows I want to hide.

I just want to have a slicer with two options: View X and View Y.

 

Is there a way to do so WITHOUT having to duplicate rows that should be visible in both views?

 

Warm regards,

Jakub

3 REPLIES 3
MFelix
Super User
Super User

Hi @jdusek92 ,

 

Create a table for the slicer with the Y / X lines then add the following measure:

Selection =
SWITCH (
    TRUE ();
    SELECTEDVALUE ( Slicer_Choice[Slicer_Choice] ) = "X"
        && (
            SELECTEDVALUE ( Views_Table[vyew] ) = "X"
                || SELECTEDVALUE ( Views_Table[vyew] ) = "Always"
        ); 1;
    SELECTEDVALUE ( Slicer_Choice[Slicer_Choice] ) = "Y"
        && (
            SELECTEDVALUE ( Views_Table[vyew] ) = "Y"
                || SELECTEDVALUE ( Views_Table[vyew] ) = "Always"
        ); 1;
    0
)

Now use tihs measure as a visual filter and select only the values equal to 1.

 

Check PBIX file attach.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hello,

I am having problem with Column chart to display the data:

Table column displays correctly:

image.png

 

 

 

 

image.png

 

I have added data to your example:

https://drive.google.com/open?id=1Wi1wRx1DyC6tUAEL0wzIa-cdQdn8v7rM

 

I want to filter by "PRIZNAK" column:

  • NORMAL selected = only NORMAL rows
  • KOREKCE selected = all rows (NORMAL+KOREKCE)

 

Warm regards,

Jakub

 

MFelix
Super User
Super User

Hi @jdusek92 ,

 

Create a table for the slicer with the Y / X lines then add the following measure:

Selection =
SWITCH (
    TRUE ();
    SELECTEDVALUE ( Slicer_Choice[Slicer_Choice] ) = "X"
        && (
            SELECTEDVALUE ( Views_Table[vyew] ) = "X"
                || SELECTEDVALUE ( Views_Table[vyew] ) = "Always"
        ); 1;
    SELECTEDVALUE ( Slicer_Choice[Slicer_Choice] ) = "Y"
        && (
            SELECTEDVALUE ( Views_Table[vyew] ) = "Y"
                || SELECTEDVALUE ( Views_Table[vyew] ) = "Always"
        ); 1;
    0
)

Now use tihs measure as a visual filter and select only the values equal to 1.

 

Check PBIX file attach.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors