Forum Discussion

Mattmcdowell_'s avatar
8 years ago

merge queries and aggregating data

Hi All,

 

I am very new to PowerBI so bear with me. 

 

My datasource is a SQL server database. It's import that I am using directquery for the report that I am working on as I need to the report to be able to refresh instantly on the service.

 

For this report I need 4 tables from my database:

1. Item

2. Sales order lines

3. Production Order Lines

4. Item history

 

With the above tables I need two tables within my one report I am creating in the desktop tool. One for location A and one location B. I have sucesfully created the report for location A by using the "Item table" as a base query and merging queries from sales order lines, production order lines, and item history. When I merge a query I then use the aggregate function to sum one of the columns and it works great.  So for location A I have merged 3 queries onto the item query and aggregated the desired column and its data points each time. Great.

 

Now when I went to do the second table/report for location B - What I did was add new data sources again for all 4 tables and followed the same steps. Using the item table as a base I merged the item history table and aggregated, all good. But when I go to merge with the sales order lines and then aggregate the column from the sales order lines table I get the message "this query step is not supported by direct query, do you want to change all tables to import".

 

I don't get why because I did the same step 4 times for location A and once for location B.

 

What gives?

2 Replies

  • Work around was to re-write the report and then merge the two reports on a dashboard. Accomplished what I was after but am still curious why I couldn't do it in the same report.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Mattmcdowell_,

    What join type do you choose in report B? In Directquery mode, only Left outer join kind is supported, you will get "This step results in a query that is not supported in DirectQuery mode" message when you choose other join types.



    Regards,
    Lydia