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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Add a column in M code and filter it on a condition based on a value in another table's column

Hi all, 

Is it possible to add a column in M code and filter that added column on a condition based on a value in a column in a related table?

For example, we want to add a column displaying all Products from the Product table that have a cost of 0. The cost column is in table Cost. So something like SELECT PRODUCT FROM PRODUCTS WHERE TOTAL_COST = 0; 

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

It si bad pratice to add M columns each time you need a filter.

 

Use a DAX  measure instead ...

Total cost = SUM('Fact costs'[Cost]) + 0
 
Then filters  Total cost = 0

 

Click here to download an example 

 

Please click thumbs up and accept as solution

 

speedramps_0-1666018153297.png

 

 

View solution in original post

1 REPLY 1
speedramps
Super User
Super User

It si bad pratice to add M columns each time you need a filter.

 

Use a DAX  measure instead ...

Total cost = SUM('Fact costs'[Cost]) + 0
 
Then filters  Total cost = 0

 

Click here to download an example 

 

Please click thumbs up and accept as solution

 

speedramps_0-1666018153297.png

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.