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
JemmaD
Resolver II
Resolver II

Create a calculated table which acts as a slicer to filter a table

At the moment I have five tables, all pre-filtered to different things and I have five bookmarks showing/hiding each table depending on which view the user wants to see. 

Call the views 'VIEW 1' 'VIEW 2' 'VIEW 3'...

Instead of bookmarks and buttons I had an idea to create a calculated table which has a column called 'View' which lists all five views, and the other attribute of the table would be to declare the filters.

Then I would place 'View' column in a slicer, and a single unfiltered table on the page, and as people change the slicer, it filters the table.

I have no idea if these functionality exists and i've just made it up entirely. If you have any ideas, please let me know!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @JemmaD ,

 

I have two table:

vbinbinyumsft_0-1657878216407.png

 

 

You can follow the below steps:

1.Create a slicer visual with table(2) and create a table visual with Table(3)

vbinbinyumsft_1-1657878233939.png

 


2.Create a measure, then choose table visual and add it to filter conditions in filter pane for table visual

 

Measure2 =
VAR slicerval =
    MAX ( 'Table (2)'[View] )
VAR view1 =
    CALCULATE (
        SUM ( 'Table (3)'[Amount] ),
        FILTER (
            'Table (3)',
            'Table (3)'[Category] = "a"
                || 'Table (3)'[Category] = "b"
        )
    )
VAR view2 =
    CALCULATE (
        SUM ( 'Table (3)'[Amount] ),
        FILTER (
            'Table (3)',
            'Table (3)'[Category] = "c"
                || 'Table (3)'[Category] = "d"
        )
    )
RETURN
    IF ( slicerval = "View1", view1, IF ( slicerval = "View2", view2, BLANK () ) )

 

vbinbinyumsft_2-1657878311871.png

 

3.When you change the slicer value, can filter the table value

vbinbinyumsft_3-1657878325834.png

 


If I misunderstand your demands, please feel free to let me know.

 


Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @JemmaD ,

 

I have two table:

vbinbinyumsft_0-1657878216407.png

 

 

You can follow the below steps:

1.Create a slicer visual with table(2) and create a table visual with Table(3)

vbinbinyumsft_1-1657878233939.png

 


2.Create a measure, then choose table visual and add it to filter conditions in filter pane for table visual

 

Measure2 =
VAR slicerval =
    MAX ( 'Table (2)'[View] )
VAR view1 =
    CALCULATE (
        SUM ( 'Table (3)'[Amount] ),
        FILTER (
            'Table (3)',
            'Table (3)'[Category] = "a"
                || 'Table (3)'[Category] = "b"
        )
    )
VAR view2 =
    CALCULATE (
        SUM ( 'Table (3)'[Amount] ),
        FILTER (
            'Table (3)',
            'Table (3)'[Category] = "c"
                || 'Table (3)'[Category] = "d"
        )
    )
RETURN
    IF ( slicerval = "View1", view1, IF ( slicerval = "View2", view2, BLANK () ) )

 

vbinbinyumsft_2-1657878311871.png

 

3.When you change the slicer value, can filter the table value

vbinbinyumsft_3-1657878325834.png

 


If I misunderstand your demands, please feel free to let me know.

 


Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

PaulDBrown
Community Champion
Community Champion

I'm not sure how you are setting up the bookmarks/buttons, but with the inclusion of the buttons based on bookmarks, it's simple to set up, and the behaviour emulates that of a slicer

2022-07-11 (1).png

buttonsslicer.gif

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






@PaulDBrown Yes that's how i've set up the bookmarks, but I would rather avoid them altogether if possible, they're clunky, slow and very manual. 

amitchandak
Super User
Super User

@JemmaD , I assume already explored field parameters can not help

https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...

 

Looking at description field parameter and bookmark, both might be needed

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak your link suggestion was the inspiration for my idea, but it just changes the axis and I need it not to change the axis, but to filter the data.

I was hoping I could say View Selection = {
"View1", FILTER(
'table1'[category]="a" ||

'table1'[category]="b",

"View 2", FILTER(

'table1'[category]="c" ||

'table1'[category]="d")}

 

I guess i'm stuck with wretched bookmarks for now 😞

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.