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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Greg_Deckler
Community Champion
Community Champion

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



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

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

Greg_Deckler
Community Champion
Community Champion

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



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks a lot, it works perfect!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.