cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Regular Visitor

## DAX Formula Help

Hello,

I am compare last years actual spend to this years actual spend. So I'd like to take FY24 - FY23. I was able to accomplish something similiar by using this DAX:

FY24 Actual vs. FY24 Budget =
VAR ActualAmount = SUM('FY24 Trial Balances'[Actual Spend])
VAR BudgetAmount = SUM('FY24 Budget'[Budget])
RETURN ActualAmount - BudgetAmount

This compares FY24 actual spend to the budgeted amount for FY24. The problem I run into when I do this for FY24 - FY23 is an issue with dates. I currentl doing this:

FY24 vs. FY23 =
VAR ActualAmount = SUM('FY24 Trial Balances'[Actual Spend])
VAR ActualAmount23 = SUM('FY23 Trial Balances'[Actual Spend])
RETURN ActualAmount - ActualAmount23

But what I return if I look at a table visual is something like this:

What I actually want is take the Septmeber 2023, which is FY24, and subtract Septmber 2022, which is FY23. So I'd want 4-5 which would result in -1. Again showing that actual spend in FY24 is less than was actual spend in FY23.

Anything helps and thanks in advance!!!

Steve

1 ACCEPTED SOLUTION
Super User

Try removing the year column from the table visual. The year column breaks the months into two parts, i.e., in Sept 2022 the FY24 is 0, and Sept 2023 FY23 is blank.

2 REPLIES 2
Regular Visitor

Thank you! I should have thought of that lol.

Super User

Try removing the year column from the table visual. The year column breaks the months into two parts, i.e., in Sept 2022 the FY24 is 0, and Sept 2023 FY23 is blank.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.