Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hello,
I got another question
is it possible to calculate the difference within one column between two months?
E.g.
Month: January
Product launch: 5
Month: February
Product launch: 7
--> calculate in new column the difference between "Product launch" February and "Product launch" January:
7-5 = +2
Explanation
Maybe anybody know a solution.
Thank you in advance!
Julia
Solved! Go to Solution.
Hi @JuliaWendel
Try this solution.
If you donot have a column for Month Numbers... add this calculated column
Month_Number =
SWITCH (
Table1[Months],
"January", 1,
"February", 2,
"March", 3,
"April", 4,
"May", 5,
"June", 6,
"July", 7,
"August", 8,
"September", 9,
"October", 10,
"November", 11,
"December", 12
)Now you can get the desired difference column using below
Difference =
VAR PreviousMonthValue =
CALCULATE (
SUM ( Table1[Product Launch] ),
FILTER (
ALL ( Table1 ),
Table1[Month Number]
= EARLIER ( Table1[Month Number] ) - 1
&& Table1[Year] = EARLIER ( Table1[YEAR] )
)
)
VAR PreviousMonthValueforJan =
CALCULATE (
SUM ( Table1[Product Launch] ),
FILTER (
ALL ( Table1 ),
Table1[Month Number] = 12
&& Table1[Year]
= EARLIER ( Table1[YEAR] ) - 1
)
)
RETURN
Table1[Product Launch]
- IF ( Table1[Month_Number] = 1, PreviousMonthValueforJan, PreviousMonthValue )
Hi @JuliaWendel,
Have you tried the solution provided by @Zubair_Muhammad above? Does it work in your scenario? If it works, could you accept it as solution to close this thread?
If you still have any question on this issue, feel free to post here. ![]()
Regards
Hi @JuliaWendel,
Have you tried the solution provided by @Zubair_Muhammad above? Does it work in your scenario? If it works, could you accept it as solution to close this thread?
If you still have any question on this issue, feel free to post here. ![]()
Regards
Hi @JuliaWendel
Try this solution.
If you donot have a column for Month Numbers... add this calculated column
Month_Number =
SWITCH (
Table1[Months],
"January", 1,
"February", 2,
"March", 3,
"April", 4,
"May", 5,
"June", 6,
"July", 7,
"August", 8,
"September", 9,
"October", 10,
"November", 11,
"December", 12
)Now you can get the desired difference column using below
Difference =
VAR PreviousMonthValue =
CALCULATE (
SUM ( Table1[Product Launch] ),
FILTER (
ALL ( Table1 ),
Table1[Month Number]
= EARLIER ( Table1[Month Number] ) - 1
&& Table1[Year] = EARLIER ( Table1[YEAR] )
)
)
VAR PreviousMonthValueforJan =
CALCULATE (
SUM ( Table1[Product Launch] ),
FILTER (
ALL ( Table1 ),
Table1[Month Number] = 12
&& Table1[Year]
= EARLIER ( Table1[YEAR] ) - 1
)
)
RETURN
Table1[Product Launch]
- IF ( Table1[Month_Number] = 1, PreviousMonthValueforJan, PreviousMonthValue )
Thank you 🙂
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 41 | |
| 37 | |
| 34 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 59 | |
| 31 | |
| 25 | |
| 25 |