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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Add Yes/No column in Power Query

Hello

 

I have the solution in Dax using Related, but I can't get a one to many relationship on the tables I'm using. So I wanted to check if there is a solution in Power Query "Add conditional column"?

 

I want to a Yes/No column based on a few criteria from another table. The statement would be along the lines below

 

if [id] = table2[id] and [group] = table2[group] and [start_time] >= table2[start_time] and [start_time] <= table2[end_time] then "yes" else "no"

 

If there is a solution in DAX that would work without a relationship, that would be helpful too

 

Thanks

3 REPLIES 3
amitchandak
Super User
Super User

You should be able to do it. Check I got two columns like that. Just need to ensure one value you have to use some function

 

 

Max Sales order id = Maxx(filter(sales,Sales[item_id]='Item'[Item ID]),Sales[Order Id]) 
Max customer = MAXX(filter(Sales,Sales[Order Id]='Item'[Max Sales order id] && Sales[item_id]='Item'[Item ID]),Sales[Customer ID])

 

 

These are columns, not measures.

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak  Thanks for replying

 

I struggling to understand your answer.

 

I have two tables with no relationship and I want to add a yes/no column to Table1 based on matching some criteria in table2.

 

I have a DAX query below that works if I have a 1 to Many relationship. If the tables have a relationship on the IDs, it wll be Many to Many as I have multiple entries. 

 

Correct = IF(([Name] = RELATED(TableB[Name])) && ([REAL_TIME] >= RELATED(TableB[REAL_TIME - 3] )) && (TableA[REAL_TIME] <= RELATED(TableB[REAL_TIME + 3])), "YES" , "NO")

 

Thanks

Joe

Hi @Anonymous ,

 

Kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.