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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Rows related by either of 2 fields

I have a table of customer records and am looking to filter by any single record and subsequently display all records with the same Name OR same SSN as that single record. 

 

IndexNameTaxID
1John Smith333333333
2John R. Smith333333333
3John Smithnull
4Mary Johnson444444444
5M. Johnson444444444
6M. Johnson222222222

 

And example for this dataset would be: If I select the first row, rows 1,2, and 3 would be displayed.

 

I do not believe this is possible using the Drillthrough feature, but I feel as if there may be some way to model the data and filter by a measure that could work.

 

Any help is appreciated, thank you!

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @Anonymous ,

 

Fisrtly, you should extract the last name from [Name] column in Query Editor mode.

1.PNG

 

Apply above changes. In report view, create an extra table as below which is unrelated to source table. You should add field from this new table into slicer.

Copy table = VALUES(Table1)

Add below measure into visual level filter and set its value to 1.

Measure =
IF (
    CALCULATE ( MAX ( 'Table1'[Name.2] ) )
        = CALCULATE (
            VALUES ( 'Table1'[Name.2] ),
            FILTER ( 'Table1', 'Table1'[Name.2] = SELECTEDVALUE ( 'Copy table'[Name.2] ) )
        ),
    1,
    0
)

1.PNG

Best regards,

Yuliana Gu

 

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you for the thorough answer! However, I am afraid I lead you astray in trying to simplify my sample data. I am still new to posting here. I am dealing with records whose Name filed could contain "THE CITY OF PHOENIX, AZ" or "COCA COLA" or "John and Mary Smith" as well as simple names. I have given a more fitting sample of an expected aggregation below.

 

 

IndexNameTaxID
1Coca-Cola444444444
2Coke LLC444444444
3Coca-Cola222222222

 

Ultimately the only way to relate all three of these records, as I see it, is a variation on your original solution that filters for matching names OR matching TaxID. I just do not know how to implement that logic.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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