cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lcerrapa Helper I
Helper I

Exclude rows on table based on another table at query design

Hello.

I don't find the answer to this question, I hope you can help me.

 

I have a query against a database that obtains data:

 

select year, projection from DimProjections where <conditions>

 

The result of this query is ALWAYS one row with this structure:

 

YEAR    PROJECTION

------   -----------------

2016    PROJECTION10

 

I have a FactSales table with many years and many projections (and many other fields), and I need to obtain all the rows except the result of the previous query (all data without 2016 year and PROJECTION10 projection combination).

 

How can I do this?

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: Exclude rows on table based on another table at query design

Perhaps a Merge query using a Right Anti join (or Left Anti join depending on which one of your queries you consider "first".


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
Super User IV
Super User IV

Re: Exclude rows on table based on another table at query design

Perhaps a Merge query using a Right Anti join (or Left Anti join depending on which one of your queries you consider "first".


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

Community Support
Community Support

Re: Exclude rows on table based on another table at query design

Hi @lcerrapa,

 

smoupre's reply seems well, perhasps you can try it.
In addition, if you use the sql database, you can directly use t-sql query to merge the table at sql statement option:

 

Capture.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
lcerrapa Helper I
Helper I

Re: Exclude rows on table based on another table at query design

Thanks a lot, it works perfect!!

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors