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

how to filter using another column

Ok so i have 2 columns, each one from a diferent table, in their tables they are called the same "division_id" when i select both columns to make a graph or a table, they appear with different names.

 

The table is something like this

 

NameIDdivison_id SOdivision_id Partner
Company 112020
Company 222015
Company 131313
Company 1 41010
Company 25023

 

Ok, so what i need to do is, only show the rows where the "Divison_id" are not equal

something like this:

 

NameIDdivison_id SOdivision_id Partner
Company 222015
Company 25023

 

How do i do this pls help (sorry for bad english)

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

Hi @mreig ,

 

I did it in three ways, please check.

 

  • Method1: In Power Query:

Merge as new Queries --> Expand and remain only division_id column--> Add a custom column with a flag (1 or 0) --> Filter out Custom column =0:

in power query.PNG

The final output is shown below:

use Merge.PNG

 

 

  • Method2: Use DAX to add a new table:

As @Aditya_Meshram said, you could use LOOKUPVALUE() to create a new table like this:

New Table = 
var _t=ADDCOLUMNS('Sale_order',"division_id res", LOOKUPVALUE('Res_partner'[division_id],[Name],[Name],[ID],[ID]))
return FILTER(_t,[divison_id]<>[division_id res])

use DAX to create a new table.PNG

 

 

  • Method3: Use DAX to create measures:
Measure = IF(MAX('Res_partner'[division_id])<>MAX('Sale_order'[divison_id]),1)

 Then apply the measure to filter pane, set as "is 1", the final output is shown below:

use measure to filter.PNG

Best Regards,
Eyelyn Qin
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

6 REPLIES 6
v-eqin-msft
Community Support
Community Support

Hi @mreig ,

 

I did it in three ways, please check.

 

  • Method1: In Power Query:

Merge as new Queries --> Expand and remain only division_id column--> Add a custom column with a flag (1 or 0) --> Filter out Custom column =0:

in power query.PNG

The final output is shown below:

use Merge.PNG

 

 

  • Method2: Use DAX to add a new table:

As @Aditya_Meshram said, you could use LOOKUPVALUE() to create a new table like this:

New Table = 
var _t=ADDCOLUMNS('Sale_order',"division_id res", LOOKUPVALUE('Res_partner'[division_id],[Name],[Name],[ID],[ID]))
return FILTER(_t,[divison_id]<>[division_id res])

use DAX to create a new table.PNG

 

 

  • Method3: Use DAX to create measures:
Measure = IF(MAX('Res_partner'[division_id])<>MAX('Sale_order'[divison_id]),1)

 Then apply the measure to filter pane, set as "is 1", the final output is shown below:

use measure to filter.PNG

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

selimovd
Super User
Super User

Hey @mreig ,

 

add a new calculated column and compare if they are equal:

Check DivisionID = myTable[divison_id SO] = myTable[division_id Partner]

 

Then filter on "false" values and you got all the records where they are different.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

mreig_0-1626951788388.png

I have this two tables, inside they have the "division_id" column.

mreig_1-1626951858400.png

When i select both and many other columns it appears a table.

mreig_2-1626952002387.png

Ok, so how do i creata a new calculated column here ?

 

Aditya_Meshram_0-1626952511057.png

 

Go to data view and click here

I know but this column is crated in one of the tables.

 

mreig_0-1626952802775.png

I cannot get the column from the other table.

You can try using Lookupvalue.

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.