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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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