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
Connell
Regular Visitor

Issue With Filtering

Hello,

 

Here is an example of my situation - I have two tables with a one-to-one relationship.

Table X  

Sally12
Tom30
John20
Doe12
Emily9
Bob2

 

And Table Y

John@
Doe#
Emily$
Bob%

 

I put Name from Table Y and Value from Table X together and I get 

 12
 30
John20
Doe12
Emily9
Bob2

 

obviously I dont want the blank rows, just the names from Table Y and those values. 

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi  @Connell ,

 

Create a measure as below:

_Value = IF(MAX('Table X'[Name]) in FILTERS('Table Y'[Name]),MAX('Table X'[Value]),BLANK())

And you will see:

Annotation 2020-08-17 124155.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

3 REPLIES 3
v-kelly-msft
Community Support
Community Support

Hi  @Connell ,

 

Create a measure as below:

_Value = IF(MAX('Table X'[Name]) in FILTERS('Table Y'[Name]),MAX('Table X'[Value]),BLANK())

And you will see:

Annotation 2020-08-17 124155.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
pranit828
Community Champion
Community Champion

HI @Connell 

 

Your issue is because of the join you have on both tables.

pranit828_0-1597446572194.png

 

Double click on the tiny arrow as in picture above.

You have to select the first table second and second table as first in the "Edit Relationship window".

 

pranit828_1-1597446779867.png

 

 

Did I resolve your issue? Mark my post as a solution! Appreciate your Kudos, Press the thumbs up button!!

 

Regards,
Pranit





PBI_SuperUser_Rank@1x.png


Hope it resolves your issue? 
Did I answer your question? Mark my post as a solution!

Appreciate your Kudos, Press the thumbs up button!!
Linkedin Profile
FrankAT
Community Champion
Community Champion

Hi @Connell 

you can do it with Power Query like this:

// Table X
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCk7MyalU0lEyNFKK1YlWCsnPBXKMDcAcr/yMPCDPCMJzyU9FqHPNzQRrswTznPKTQOqUYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", Int64.Type}}),
    #"Merged Queries" = Table.NestedJoin(#"Changed Type", {"Column1"}, #"Table Y", {"Column1"}, "Table Y", JoinKind.LeftOuter),
    #"Expanded Table Y" = Table.ExpandTableColumn(#"Merged Queries", "Table Y", {"Column1"}, {"Column1.1"}),
    #"Removed Other Columns" = Table.SelectColumns(#"Expanded Table Y",{"Column1.1", "Column2"}),
    #"Filtered Rows" = Table.SelectRows(#"Removed Other Columns", each ([Column1.1] <> null))
in
    #"Filtered Rows"

// Table Y
let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8srPyFPSUXJQitWJVnLJTwWylcFs19zMnEogTwXMc8pPArJVlWJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}})
in
    #"Changed Type"

Insert both M-Codes in advanced editor.

Regards FrankAT

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.