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
baconandpizza
New Member

Cascading Filters and Columns

Hi,

 

Could you help me set up my data in a way where the slicers are cascading along with the visual.

Here is a sample data:

baconandpizza_2-1693162989987.png

 

And this is how I want my visualization to look like:

baconandpizza_3-1693163073370.png

 

To explain further, I if Ticket 1 is filtered (for example, it is filtered to A), Ticket 2 will be in the visualization (so, it should be AA and BB in the chart). But, how can I do this without dragging each column in the visual field when I change the filters.

 

Since, I want my chart to show Ticket 3 in the X-axis when Ticket 2 is filtered. I have to drag Ticket 3 column in the visual to do this. Is there a way to do this?

 

Thank you so much!

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @baconandpizza ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Select the columns "Ticket 1", "Ticket 2","Ticket 3","Ticket 4" and "Ticket 5" and unpivot these columns

= Table.Unpivot(#"Changed Type", {"Ticket 1", "Ticket 2", "Ticket 3", "Ticket 4", "Ticket 5"}, "Ticket Type", "Value")

vyiruanmsft_0-1693296347838.png

2. Create a dimension table

Tickets = GROUPBY('Table','Table'[Ticket Type],'Table'[Value])

vyiruanmsft_2-1693296466384.png

3. Create a measure as below to get the count of customer id which fulfill the filters

Count of customer = 
VAR _selticket =
    SELECTEDVALUE ( 'Tickets'[Ticket Type] )
VAR _seltvalue =
    ALLSELECTED ( 'Tickets'[Value] )
VAR _nticket =
    (
        LEFT ( _selticket, LEN ( _selticket ) - 1 )
            & ( VALUE ( RIGHT ( _selticket, 1 ) ) + 1 )
    )
VAR _tab =
    CALCULATETABLE (
        VALUES ( 'Table'[Customer ID] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Ticket Type] = _selticket
                && 'Table'[Value] IN _seltvalue
        )
    )
VAR _tab2 =
    CALCULATETABLE (
        VALUES ( 'Table'[Value] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Ticket Type] = _nticket
                && 'Table'[Customer ID] IN _tab
        )
    )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Customer ID] ),
        FILTER ( 'Table', 'Table'[Value] IN _tab2 )
    )

4. Create a column chart

vyiruanmsft_3-1693296536710.png

By the way, if select "Ticket 5", what's the data should display in the visual?

Best Regards

Community Support Team _ Rena
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

1 REPLY 1
v-yiruan-msft
Community Support
Community Support

Hi @baconandpizza ,

I created a sample pbix file(see the attachment), please check if that is what you want.

1. Select the columns "Ticket 1", "Ticket 2","Ticket 3","Ticket 4" and "Ticket 5" and unpivot these columns

= Table.Unpivot(#"Changed Type", {"Ticket 1", "Ticket 2", "Ticket 3", "Ticket 4", "Ticket 5"}, "Ticket Type", "Value")

vyiruanmsft_0-1693296347838.png

2. Create a dimension table

Tickets = GROUPBY('Table','Table'[Ticket Type],'Table'[Value])

vyiruanmsft_2-1693296466384.png

3. Create a measure as below to get the count of customer id which fulfill the filters

Count of customer = 
VAR _selticket =
    SELECTEDVALUE ( 'Tickets'[Ticket Type] )
VAR _seltvalue =
    ALLSELECTED ( 'Tickets'[Value] )
VAR _nticket =
    (
        LEFT ( _selticket, LEN ( _selticket ) - 1 )
            & ( VALUE ( RIGHT ( _selticket, 1 ) ) + 1 )
    )
VAR _tab =
    CALCULATETABLE (
        VALUES ( 'Table'[Customer ID] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Ticket Type] = _selticket
                && 'Table'[Value] IN _seltvalue
        )
    )
VAR _tab2 =
    CALCULATETABLE (
        VALUES ( 'Table'[Value] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            'Table'[Ticket Type] = _nticket
                && 'Table'[Customer ID] IN _tab
        )
    )
RETURN
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Customer ID] ),
        FILTER ( 'Table', 'Table'[Value] IN _tab2 )
    )

4. Create a column chart

vyiruanmsft_3-1693296536710.png

By the way, if select "Ticket 5", what's the data should display in the visual?

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.