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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
msedlak
Frequent Visitor

Create New Query Based on a Column In Another Query

Hello,

 

I have three queries:

 

1) Customers with customer information

2) Providers in Network

3) Provider Prospects

 

I have done a cross join to join queries 1 and 2 then used a distance formula to determine if a provider in network covers a customer location.  If they are covered I bulit a new column that labels row yes or no.

 

I would like to build a 4th query that is filled only with rows labeled no from query 1.

 

How do I accomplish this?

 

Thank you,

Mark

2 REPLIES 2
Greg_Deckler
Super User
Super User

If you want to do this in Power Query, then you would create a query that references your other query. Right click query 1 and choose Reference. Then you would filter for no.

 

In DAX, you would create a new table with a formula like:

 

Table 4 = FILTER('Table 1',[Label] = "No")


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

You can create a new column in table using other tables like

.

New column in Table 1 = maxx(filter(table2,table1[customer] = table2[customer] && table2[option]="construction",table2[value])
New column in Table 1 = maxx(filter(table2,table1[Attribute] = table2[name] && table1[project] = table2[project]),table2[name])

new Column =
LOOKUPVALUE('Table'[Lot No.], 'Table'[Entry Type], "Output", 'Table'[Document No.], firstnonbank('Table'[Document No.],true()))
OR
new Column =
minx(filter('Table', 'Table'[Entry Type]= "Output" && 'Table'[Document No.]= earlier('Table'[Document No.])),'Table'[Lot No.])

In case it does not help

Can you share sample data and sample output.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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