Hi I have two tables:
Let's say MARCH is current month, I want a measure to provide result so that all previous months are taken from Table1 and current month and onwards data comes from Table2, example below:
Thanks for your help.
Go to Solution.
Hi @mb0307 ,
Sorry for my late reply.
You could use SUMMARIZE() to select columns when there are different number of columns between tables :
Table 3 =
VAR t1 =
SUMMARIZE ( 'Previous', [ Sales], Previous[Month Year ] ),
MONTH ( Previous[Month Year ] ) < 3
VAR t2 =
SUMMARIZE ( 'After', [ Projections], 'After'[Month Year ] ),
MONTH ( 'After'[Month Year ] ) >= 3
UNION ( t1, t2 )
Then the new table will be like this:
Did I answer your question ? Please mark my reply as solution.
If not, please upload some insensitive data samples and expected output.
View solution in original post
Hi @mb0307 ,
According to my understanding, you want to combine two tables based on current month-year , right?
You could use the following formula:
FILTER ( 'Previous', 'Previous'[Month Year ].[MonthNo] < 3 ),
FILTER ( 'After', 'After'[Month Year ].[MonthNo] >= 3 )
My visualization looks like this:
@Eyelyn9 Thanks for you response but I am getting this error: "Each table argument of 'UNION' must have the same number of columns."
My two tables have different set of columns. I want Sales and Projections union resulted in a same column please.
Any help with this query will be much appreciated.
Click here to read more about the October 2021 Release!
Explore the latest tools,training sessions,technical expertise, networking and more.
Mark your calendars and join us for our next Power BI Dev Camp!