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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
v-binbinyu-msft
Community Support
Community Support

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
v-binbinyu-msft
Community Support
Community Support

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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