Forum Discussion
Group Column Values based on another column value?
- 2 years ago
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
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 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