Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
How do I create a new table?. The table will be made by subtracting two columns from two different tables?. These are the two tables I am trying to subtract:
Any help is appreciated.
@HamidBee , You need to have common dimensions like Attributes and can have measure like and analyze against common dimensions
Sum(2020[value]) -sum(2021[value])
They should have the same months and values if one was to analyze it row by row. Is that what you mean by common dimensions? Also is there a specific DAX code that is used for subtracting columns like this.
@HamidBee , You have a calendar table, In that, you should have a month (without year) to compare against month
You should prefer measure to subtract data across two tables
Bridge Table: https://www.youtube.com/watch?v=Bkf35Roman8&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=19
I was thinking to do a measure. But I really would like the difference to be inside a table because I plan to create a colour field. If I can get this calculcation onto a table it would make things alot simpler for me long term. Should I make a measure then put the measure into a table seperated by months.
Hi @HamidBee ,
Can you provide some dummy data?
If it is the following data.
Here's the solution.
1.Create a month column in both tables.
Month = FORMAT([Dates],"MMM")
2.Create a measure.
Difference =
VAR _20 =
SUM ( '2020'[Value] )
VAR _21 =
CALCULATE (
SUM ( '2021'[Value] ),
FILTER (
'2021',
[Attribute] = MAX ( '2020'[Attribute] )
&& [Month] = MAX ( '2020'[Month] )
)
)
RETURN
_20 - _21
3.Results.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 94 | |
| 70 | |
| 50 | |
| 40 | |
| 39 |