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

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

Reply
AHONORESR
Regular Visitor

Dynamic grouping according to slicer

Hi guys!

 

I've been struggling around the generation of different groups according to the parameter that I select on a slicer with unique selection. For example, If I have this table down below:

CategoryVendorUnits
ShirtsA20
TrousersA30
ShirtsB10
TrousersB10
ShirtsC15
TrousersC20
ShirtsD5

 

If I put on the slicer the variable "Vendor", and I select the parameter "A", I would like to have a table like this:

CategoryVendorUnits
ShirtsA20
TrousersA30
ShirtsOther10
TrousersOther10
ShirtsOther15
TrousersOther20
ShirtsOther5

 

So I can have this representation:

 

AHONORESR_0-1663876790143.png

 

And obviously whenever I change the parameter in the slicer, it dynamically update the grouping, so I can always compare the percentage of one vendor against the rest of them.

 

I'd really appreciate any help/guidance with this.

 

Thanks in advance!

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

Hi @AHONORESR ,

 

Is this you want?

vchenwuzmsft_0-1663923164745.gif

 

If yes, you need create two table via UNION(VALUES('Table'[Vendor]),{"other"}), one for lengend and anoter for slicer.

 

1 values of bar chart:

 

values =
VAR _v =
    VALUES ( 'slicer'[Vendor] )
VAR _s =
    CALCULATE (
        SUM ( 'Table'[Units] ),
        FILTER (
            'Table',
            [Vendor]
                IN _v
                    && [Vendor] = SELECTEDVALUE ( 'legend'[Vendor] )
        )
    )
VAR _o =
    CALCULATE ( SUM ( 'Table'[Units] ), FILTER ( 'Table', NOT ( [Vendor] IN _v ) ) )
RETURN
    IF ( SELECTEDVALUE ( 'legend'[Vendor] ) = "other", _o, _s )

 

 

2 filterpane:

 

filterpane =
IF (
    SELECTEDVALUE ( legend[Vendor] )
        IN VALUES ( 'slicer'[Vendor] )
            || SELECTEDVALUE ( legend[Vendor] ) = "other",
    1
)

 

 put this measure in filter pane of this column chart and set it is 1

 

 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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

3 REPLIES 3
v-chenwuz-msft
Community Support
Community Support

Hi @AHONORESR ,

 

Is this you want?

vchenwuzmsft_0-1663923164745.gif

 

If yes, you need create two table via UNION(VALUES('Table'[Vendor]),{"other"}), one for lengend and anoter for slicer.

 

1 values of bar chart:

 

values =
VAR _v =
    VALUES ( 'slicer'[Vendor] )
VAR _s =
    CALCULATE (
        SUM ( 'Table'[Units] ),
        FILTER (
            'Table',
            [Vendor]
                IN _v
                    && [Vendor] = SELECTEDVALUE ( 'legend'[Vendor] )
        )
    )
VAR _o =
    CALCULATE ( SUM ( 'Table'[Units] ), FILTER ( 'Table', NOT ( [Vendor] IN _v ) ) )
RETURN
    IF ( SELECTEDVALUE ( 'legend'[Vendor] ) = "other", _o, _s )

 

 

2 filterpane:

 

filterpane =
IF (
    SELECTEDVALUE ( legend[Vendor] )
        IN VALUES ( 'slicer'[Vendor] )
            || SELECTEDVALUE ( legend[Vendor] ) = "other",
    1
)

 

 put this measure in filter pane of this column chart and set it is 1

 

 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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

This is exactly what I needed... thanks a lot!

parry2k
Super User
Super User

@AHONORESR 

check this video on my YT channel and tweak it as you see fit Compare selected customer sales with other customers - various methods (Part 1) - YouTube

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
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