Reply
Regular Visitor
Posts: 29
Registered: ‎09-12-2018
Accepted Solution

Merge query with daily values and other with monthly values?

I have this table that shows daily values for this 'Busbar' (also hour detail).

 

PBIDesktop_2018-10-11_11-04-11.png

 

Also,  I have this other query which only shows values for every month (in source .xlsx file I wrote "august-18" but it asummes the first day of that monyh). My objective then, is to take the monthly average of the query above (which has 31 days for august-18, for example) and merge it with this second query that has a value for the entire month. 

 

PBIDesktop_2018-10-11_11-06-49.png

What I'm thinking to do is to create a 'Month' column in both queries, but the first query contains about 50 million rows and I'd like to check if there's a better approach.

 

Thanks! 

 

 


Accepted Solutions
Highlighted
t_R Member
Member
Posts: 96
Registered: ‎06-20-2018

Re: Merge query with daily values and other with monthly values?

Hi @dvhez,

 

Not sure if you have an issue or just looking for an optimal solution but I'd proceed by adding a month column into the first query, then grouping by month (+other columns you want to group by) and aggregating the column you want as average. This will give you table with monthly averages. Then that can be merged with the other table.

 

Does this approach help or have I misunderstood your objective?

 

Br,

T

View solution in original post


All Replies
Highlighted
t_R Member
Member
Posts: 96
Registered: ‎06-20-2018

Re: Merge query with daily values and other with monthly values?

Hi @dvhez,

 

Not sure if you have an issue or just looking for an optimal solution but I'd proceed by adding a month column into the first query, then grouping by month (+other columns you want to group by) and aggregating the column you want as average. This will give you table with monthly averages. Then that can be merged with the other table.

 

Does this approach help or have I misunderstood your objective?

 

Br,

T