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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Hoping
Helper III
Helper III

Group based on slicer selection

I would like to group rows and concatenate the values of a column depending on slicer selection.

 

My data looks like this:

 

Hoping_0-1697038341724.png

 

The slicer selection is on Col2 and Col3

IF slicer selection is (Col2=All) i.e no filtering

Hoping_1-1697038509808.png

 

IF slicer selection is (Col2=Group1)

Hoping_2-1697038578630.png

 

How can I achieve this ?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Hoping ,

I have created a simple sample, please refer to my pbix file to see if it helps you.

Create another with col2 in slicer.

Table 2 = SUMMARIZE('Table','Table'[col2])

Then create a measure.

Measure =
VAR _1 =
    SELECTCOLUMNS ( 'Table 2', "a", 'Table 2'[col2] )
RETURN
    CALCULATE (
        SUM ( 'Table'[col4] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[col2]
                IN _1
                    && 'Table'[col5=concatenated col2]
                        = SELECTEDVALUE ( 'Table'[col5=concatenated col2] )
        )
    )

 

vrongtiepmsft_0-1697162223946.pngvrongtiepmsft_1-1697162239486.png

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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
Anonymous
Not applicable

Hi @Hoping ,

I have created a simple sample, please refer to my pbix file to see if it helps you.

Create another with col2 in slicer.

Table 2 = SUMMARIZE('Table','Table'[col2])

Then create a measure.

Measure =
VAR _1 =
    SELECTCOLUMNS ( 'Table 2', "a", 'Table 2'[col2] )
RETURN
    CALCULATE (
        SUM ( 'Table'[col4] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[col2]
                IN _1
                    && 'Table'[col5=concatenated col2]
                        = SELECTEDVALUE ( 'Table'[col5=concatenated col2] )
        )
    )

 

vrongtiepmsft_0-1697162223946.pngvrongtiepmsft_1-1697162239486.png

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

 

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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