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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
tamer_mn
New Member

Filter table based on other table with if condition

hello,

 

the case is as follows:

i need to apply a filter on the table items; where it will filter based on a dimension in another table; meaning

if customer.market = "x" then item.buid = "y" else item.buid="z"

am trying to apply this on the advanced editor and since am new to DAX am its taking me forever to write the syntax correctly;

this is what i came up so far but its not working, cz its not recognizing market dim from the other table

 

#"Filtered Rows" = Table.SelectRows(BIDW_ITEM, each [ITEM_KEY] <> 123 and (each if BIDW_Customer[Market]="xx" then [BU_ID]="yy" else [BU_ID] = "zz")),

 

 

now i understand that the table.selectrows is being bound to scope of table item; but i tried filter and related functions and i cant seem to come up with the correct structure for the filter

am already goingin through tutorials on learning DAX from scratch, but it will need time

 

any help is much appreciated

 

regards,

2 REPLIES 2
BhaveshPatel
Community Champion
Community Champion

You can use Conditional Column to achieve your desired output as it works on the If..Else logic, this will return you the expected result.

 

If you can post the sample data, I would be happy to provide you a solution.

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.
Stachu
Community Champion
Community Champion

does it have to be performed in single step?

if no, then I would:'

1) merge the two tables adding [BU_ID] to your original table

2) create new column with comparison

3) filter on that

4) remove unnecessary columns



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors