Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
HamidBee
Power Participant
Power Participant

How do I create a new Table with two columns from two different tables (No measures)?

I am trying to create a new table which contains two columns. Column 1 will calculate the difference between Value 2021 and Value 2020. Column 2 will calculate the percentage change using value 2020 as the base number. I am including the example file below:

 

https://www.mediafire.com/file/26gimtjb8cshhpx/Example.pbix/file

 

Thanks in advance. 

 

1 ACCEPTED SOLUTION

Hi, @HamidBee 

You don't need add a new table, you can directly add calculated columns to the table ‘2021’ as follows:

Dates_1 = DATEADD('Calendar'[Date],-1,YEAR)
Value_1 = LOOKUPVALUE('2020'[Value],'2020'[Dates],'2021'[Dates_1],'2020'[Attribute],'2021'[Attribute])
Difference = '2021'[Value]-'2021'[Value_1]
Percentage = IF('2021'[Value_1]=0,BLANK(),'2021'[Difference]/'2021'[Value_1])*100

Result:

77.png

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
HamidBee
Power Participant
Power Participant

Hi. I am trying to create a table that looks like the following:

 

Table_Merged.png

For the dates I only really wanted the month to remain and for their to be only one date column. The difference column is the difference between the 2021 and 2020 value. It is already ordered correctly so row 1 -row 1, row 2-row 2 etc.

aj1973
Community Champion
Community Champion

Hi @HamidBee 

After adding Table Attribute like @ebeery  proposed you can add this Table according to Attribute Granularity

aj1973_0-1640819924674.png

It wouldn't make sense to use Date as the Granularity since the 2 tables (2020 & 2021) are containing different values from 2 different years  

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

I was really only hoping that the month would show as that is what I am comparing. Please see the answer I sent to "ebeery".

Hi, @HamidBee 

You don't need add a new table, you can directly add calculated columns to the table ‘2021’ as follows:

Dates_1 = DATEADD('Calendar'[Date],-1,YEAR)
Value_1 = LOOKUPVALUE('2020'[Value],'2020'[Dates],'2021'[Dates_1],'2020'[Attribute],'2021'[Attribute])
Difference = '2021'[Value]-'2021'[Value_1]
Percentage = IF('2021'[Value_1]=0,BLANK(),'2021'[Difference]/'2021'[Value_1])*100

Result:

77.png

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ebeery
Memorable Member
Memorable Member

@HamidBee if it's just by attribute that you're looking for, you could do this simply by adding an "Attribute" dimension table to your model, and creating a couple simple measures.

Attributes = DISTINCT(UNION(DISTINCT('2020'[Attribute]),DISTINCT('2021'[Attribute])))



ebeery_1-1640818355727.png

 

 

ebeery_0-1640818298130.png

Value 2020 = SUM('2020'[Value])


Value 2021 = SUM('2021'[Value])


Difference = [Value 2021] - [Value 2020]


% Change = DIVIDE([Difference],[Value 2020])

 

ebeery
Memorable Member
Memorable Member

@HamidBee what is the desired granularity of this new table?  By date and attribute?  Or just by attribute?  Or just total?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.