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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
TribekDiego
New Member

DAX to join and filter tables

Hello, I have three tables associated,
NF->NFITEM->CFOP

NF has multiple NFITEM (many to many)
NFITEM has multiple CFOP (Many to many)

I want to create a column based on a condition of CFOP table.
CFOP[COLUMN] == condition, then value = 1, else value = 2, 3 etc.

Example:
NF.Number = 30
NFItem.Number  = 30, NFItem.Item->20, CFOP = 20 - >check condition 20, true.
NFItem.Number  = 30, NFItem.item->50, CFOP = 25 -> check condition 25, true.

NF.Number = 50
NFItem.Number  = 50, NFItem.Item->20, CFOP = 10 - >check condition 10, false.


NEW_TABLE:

NumberCondition
30True
50False

 
I'm importing the whole tables, not using power query.
I think it's possible to do with relationships + dax filter but it will be very slow, since it's many to many.

Is is better/possible to write some DAX like I suggested and put the summaryzed result in a different small table ?
or maybe having a list with NUMBERS_TRUE and NUMBER_FALSE so I could filter later, using the preprocessed result.


Thanks in advance. 

1 REPLY 1
lbendlin
Super User
Super User

You cannot create a column (a scalar value column) with M:M relationships - those return lists of values, not single values.

 

In order to create a column with data from related tables you need to be on the M side of a M:1 relationship.

Helpful resources

Announcements
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.

June 2025 community update carousel

Fabric Community Update - June 2025

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