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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
BarryFletcher
Helper III
Helper III

Group Column Values based on another column value?

Hi all,

 

I have a table with some values that I need to group other columns based on that value....

 

So I have a column called "Location" and based on that location value I have a list of names in other columns that I would like to associate with that location (hope that makes sense)

 

Example:

If the location value is "Building 1" I would like to be able to pick a list of people whose names are on other columns as being associated with that Building / Location?

 

The columns I have in the table are: "Location", "WP Owner1", "WPOwner2", WP Owner3", WP Owner4" etc etc

 

So if the location is "Building1" then I would like to associate "WP Owner 1" and "WP Owner 2" to "Building 1"

or

If the location is Building2" then I might need to associate "WP Owner 3" and "Wp Owner 4" to "Building 2"

etc

etc

 

 

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

View solution in original post

Anonymous
Not applicable

Hi, @BarryFletcher 

 

Based on your description, I have created some measures to achieve the effect you are looking for. Following picture shows the effect of the display.

vyaningymsft_0-1711350703281.png

 



vyaningymsft_1-1711350703284.png

 

Measure:

Group =

VAR _location =

    SELECTEDVALUE ( Location[Location] )

VAR _result =

    SWITCH (

        _location,

        "Building 1",

            IF (

                SELECTEDVALUE ( 'Table'[WP Owner] ) = "WP Owner 1"

                    || SELECTEDVALUE ( 'Table'[WP Owner] ) = "WP Owner 2",

                1

            ),

        "Building 2",

            IF (

                SELECTEDVALUE ( 'Table'[WP Owner] ) = "WP Owner 3"

                    || SELECTEDVALUE ( 'Table'[WP Owner] ) = "WP Owner 4",

                1

            ),

        "Building 3", IF ( SELECTEDVALUE ( 'Table'[WP Owner] ) = "WP Owner 5", 1 ),

        IF ( NOT ISFILTERED ( Location[Location] ), 1 )

    )

RETURN

    _result


Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

 

 

View solution in original post

4 REPLIES 4
BarryFletcher
Helper III
Helper III

Thank you

Anonymous
Not applicable

Hi, @BarryFletcher 

 

Based on your description, I have created some measures to achieve the effect you are looking for. Following picture shows the effect of the display.

vyaningymsft_0-1711350703281.png

 



vyaningymsft_1-1711350703284.png

 

Measure:

Group =

VAR _location =

    SELECTEDVALUE ( Location[Location] )

VAR _result =

    SWITCH (

        _location,

        "Building 1",

            IF (

                SELECTEDVALUE ( 'Table'[WP Owner] ) = "WP Owner 1"

                    || SELECTEDVALUE ( 'Table'[WP Owner] ) = "WP Owner 2",

                1

            ),

        "Building 2",

            IF (

                SELECTEDVALUE ( 'Table'[WP Owner] ) = "WP Owner 3"

                    || SELECTEDVALUE ( 'Table'[WP Owner] ) = "WP Owner 4",

                1

            ),

        "Building 3", IF ( SELECTEDVALUE ( 'Table'[WP Owner] ) = "WP Owner 5", 1 ),

        IF ( NOT ISFILTERED ( Location[Location] ), 1 )

    )

RETURN

    _result


Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

 

 

Thank you - I will try this later today

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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