The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
I'm trying to calculate same month previous year diffrence with same month current year and want to show that difference into a new column, But i dont want the total to show total of previous year, I just want to see only the total of difference like below
jan-21 10000
feb 21 15000
mar-21 25000
jan 22- 12000 2000
feb-22 20000 5000
total 7000
Hi
Will this effect total column as well along with row wise
@kb177
Please try
Previous Year Sales Difference =
VAR previousYearSales =
CALCULATE(
SUM(Sheet1[Sales]),
DATEADD(Sheet1[Dates],-1,YEAR)
)
Var currentYearSales =
CALCULATE(
SUM(Sheet1[Sales])
)
RETURN
if([Previous Year Sales] >0,currentYearSales-[Previous Year Sales],"")
User | Count |
---|---|
77 | |
76 | |
36 | |
31 | |
29 |
User | Count |
---|---|
93 | |
79 | |
57 | |
48 | |
48 |