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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
scorrera
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:
scorrera_0-1713228382604.png

 

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
ChiragGarg2512
Super User
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.

 

View solution in original post

2 REPLIES 2
scorrera
Regular Visitor

Thank you! I should have thought of that lol. 

ChiragGarg2512
Super User
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.

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.