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
gk2go
Helper II
Helper II

How to import last X days and get the rest with DirectQuery?

I have a very large table that I'm querying with DirectQuery.

I have referenced the DQ query and filtered it down to the last 90 days and set that table to import mode.

Now, is there a way to tell Power BI to answer queries from the imported table if within the last 90 days and from the DQ table if not?

6 REPLIES 6
V-pazhen-msft
Community Support
Community Support

@gk2go 

No matter which table data you are using to create visuals. Once date relationship is settled, you can just use the calendar date to filter, corresponding table data will be filtered automatically.

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

V-pazhen-msft
Community Support
Community Support

@gk2go 

You can create a calendar table including dates in both tables, and create a relationship between the Calendar table with import table and dq table Then you should able to use the calendar date column to filter visuals.

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

I have this Calendar table, but can it be that simple!?

The fields selected in the visuals need to be from one table, either import or dq. How would PBI know it should switch between these two tables?

V-pazhen-msft
Community Support
Community Support

@gk2go 

It is not support with power bi currently. You cannot have 2 connection modes for a single connection. You may submit an idea. Ideas (powerbi.com)


To achieve your requirement, you may connect to the datasource 2 times with import and dq separately. Then filter the import table to last 90 days, and filter the rest in dq table. However, I guess this is not a good choice in any perspective. 

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

V-pazhen-msft
Community Support
Community Support

@gk2go 

It is not support with power bi currently. You cannot have 2 connection modes for a single connection. You may submit an idea. Ideas (powerbi.com)


To achieve your requirement, you may connect to the datasource 2 times with import and dq separately. Then filter the import table to last 90 days, and filter the rest in dq table. However, I guess this is not a good choice in any perspective. 

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

I don't have much of a choice.. If i did how you said, how would i adapt the visuals to switch between the tables based on the date filter?

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.

Top Solution Authors
Top Kudoed Authors