Forum Discussion
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
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-Forum/ba-p/963216
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/1447523- Anonymous2 years ago
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.
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 TeamIf 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
4 Replies
- lbendlinSuper 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-Forum/ba-p/963216
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/1447523 - AnonymousNot 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.
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 TeamIf 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
- BarryFletcherHelper III
Thank you - I will try this later today
- BarryFletcherHelper III
Thank you