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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
jius
Frequent Visitor

Table or Card that shows all results related to group based on column value

Hi

I'm trying to see if it is possible in M (Power Query) to create a group (or association) so that when a specific ID is selected (where multiple choice is not possible) in a filter, that all rows (or just rows from a specific column) could be displayed based on a matching column value they share.

To explain this would be that is ID 245 was selected, it shares exact matching column "ProductType" with row ID 112. So the value to show in would be Result A in a card type visual,  or as Result B as a table showing all rows. But in either type, it would be displaying the Value in all associated rows that belong to the matching ProductType.

jius_0-1668377145007.png

 

I have tried a few different methods of doing this, but I always seem to get only a single value, matching the row containing the ID selected, and not getting both rows regardless of which ever ID is selected.  

Has anyone had to do something similar and able to help?

Thanks




1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jius ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1668394739681.png

Table2: 

create with below dax formula:

Table 2 = VALUES('Table'[ID])

vbinbinyumsft_1-1668394770648.png

2. create a measure with below dax formula

Measure =
VAR cur_id =
    SELECTEDVALUE ( 'Table 2'[ID] )
VAR tmp =
    CALCULATETABLE (
        VALUES ( 'Table'[ProductType] ),
        'Table'[ID] = cur_id,
        ALL ( 'Table' )
    )
RETURN
    IF ( SELECTEDVALUE ( 'Table'[ProductType] ) IN tmp, 1 )

3. add a slicer with "Table2", add a table visual with "Table", add above measure into the table visual filter

vbinbinyumsft_2-1668395102438.png

Animation13.gif

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
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 @jius ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1668394739681.png

Table2: 

create with below dax formula:

Table 2 = VALUES('Table'[ID])

vbinbinyumsft_1-1668394770648.png

2. create a measure with below dax formula

Measure =
VAR cur_id =
    SELECTEDVALUE ( 'Table 2'[ID] )
VAR tmp =
    CALCULATETABLE (
        VALUES ( 'Table'[ProductType] ),
        'Table'[ID] = cur_id,
        ALL ( 'Table' )
    )
RETURN
    IF ( SELECTEDVALUE ( 'Table'[ProductType] ) IN tmp, 1 )

3. add a slicer with "Table2", add a table visual with "Table", add above measure into the table visual filter

vbinbinyumsft_2-1668395102438.png

Animation13.gif

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

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