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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
crobson29
Helper I
Helper I

Check if value exists across DirectQuery - Import

I have a composite model with a DirectQuery connection to a larger finance dataset and an import connection to a smaller table that has additional PO information. I was having problems with lines in the finance data being filtered out if there was not a PO associated with them, but I built a column that converts the blanks to null for the key column and added a null line in the smaller table so that is fixed.  I am still having problems with some POs that are not in the smaller table, but I still need to show up in the table visual.  I need to build a column or a measure that checks if a PO from the large dataset is in the smaller table.  I am currently adding every possible number that could be a PO, which is resulting in a billion row table, and that is not ideal.

1 ACCEPTED SOLUTION
v-fenling-msft
Community Support
Community Support

Hi,@lbendlin 

Thanks for your concern about this issue.

 

TREATAS can be used in other situations, but DirectQuery mode really doesn't support TREATAS.

 

And I would like to share some additional solutions below.

 

Hi,@crobson29 

I am glad to help you.  

According to your description, you want to check if value exists across DirectQuery – Import? 

 

If I understand you correctly, then you can refer to my solution. 

 

Since TREATAS is not supported in DirectQuery mode, consider using a LEFT OUTER JOIN in the query that loads the data into the model. 

 

Here's a little example that I hope you find helpful. 

In the Power Query Editor click Merge Queries: 

vfenlingmsft_0-1721378885321.png

 

Select the corresponding table and corresponding field PO, and then select Left Outer in the Join kind. 

vfenlingmsft_1-1721378885324.png

 

Click on the red circle in the picture to expand the table: 

vfenlingmsft_2-1721378901367.png

 

Mismatched PO values are displayed as null values: 

vfenlingmsft_3-1721378901368.png

 

Here's some official documentation, hope it helps:

Tutorial: Shape and combine data in Power BI Desktop - Power BI | Microsoft Learn

Merge queries overview - Power Query | Microsoft Learn

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.


Best Regards,
Fen Ling,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-fenling-msft
Community Support
Community Support

Hi,@lbendlin 

Thanks for your concern about this issue.

 

TREATAS can be used in other situations, but DirectQuery mode really doesn't support TREATAS.

 

And I would like to share some additional solutions below.

 

Hi,@crobson29 

I am glad to help you.  

According to your description, you want to check if value exists across DirectQuery – Import? 

 

If I understand you correctly, then you can refer to my solution. 

 

Since TREATAS is not supported in DirectQuery mode, consider using a LEFT OUTER JOIN in the query that loads the data into the model. 

 

Here's a little example that I hope you find helpful. 

In the Power Query Editor click Merge Queries: 

vfenlingmsft_0-1721378885321.png

 

Select the corresponding table and corresponding field PO, and then select Left Outer in the Join kind. 

vfenlingmsft_1-1721378885324.png

 

Click on the red circle in the picture to expand the table: 

vfenlingmsft_2-1721378901367.png

 

Mismatched PO values are displayed as null values: 

vfenlingmsft_3-1721378901368.png

 

Here's some official documentation, hope it helps:

Tutorial: Shape and combine data in Power BI Desktop - Power BI | Microsoft Learn

Merge queries overview - Power Query | Microsoft Learn

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.


Best Regards,
Fen Ling,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

This approach will result in RI violations, and in generally bad query performance. Recommend you use TREATAS instead.

TREATAS is not supported in DirectQuery mode unfortunately.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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