Forum Discussion

gk2go's avatar
gk2go
Icon for Helper III rankHelper III
5 years ago

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    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.

    • gk2go's avatar
      gk2go
      Icon for Helper III rankHelper III

      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?

  • Anonymous's avatar
    Anonymous
    Not applicable

    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.

  • Anonymous's avatar
    Anonymous
    Not applicable

    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.

    • gk2go's avatar
      gk2go
      Icon for Helper III rankHelper III

      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?

  • Anonymous's avatar
    Anonymous
    Not applicable

    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.