Skip to main content
cancel
Showing results for 
Search instead 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

Reply
Kifl2023
Regular Visitor

Measuring Base on Year

Hello, 

 

Can you please help me with DAX to create a measure that, which can add the total of the budgeted YTD sales for current fiscal year and a seperate mesure for sales of last year. Since I will be uploading the data for the future year in the file in future thus I would like to know if there is a way I can setup a DAX, which calculates the number of sales based on the fiscal year correctly as compare to I having to go and change the measure every time. Please advise how can I do that. This is the result I'm looking for. 

 Last Fiscal Year Proposed Budget 
Net Sales 3000 (Net Sales) (2022-2023)5500 (Net Sales YTD Budget) (2023-2024)

 

Currently I have setup a measure:

Proposed Budget = CALCULATE(sum('Sample Data'[Net Sales YTD Budget]), 'Sample Data'[Fiscal Year]="2023-2024")
But I would have to change the year everytime fin Measure to reflect the change in Budget Year. Is there a way I can setup a DAX that it calculate the Proposed Budget for 2024-2025 itself without having to change the date in meaure. Please advise. Thanks. 

 

My Data: 

Kifl2023_0-1686857305130.png

 

2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @Kifl2023 ,

 

It is not clear how to draw the fiscal year. I suggest you can use TODAY() to return today's date, calculate which fiscal year this date is in, and then replace it with '2023-2024' as a variable. This way, as today's date changes, this variable will also change.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Mahesh0016
Super User
Super User

@Kifl2023 i think you should try TOTALYTD Dax.
For E.g
Current Year = 
TOTALYTD (
[Sales Amount],
'Date'[Date]
)
@Kifl2023 Thank You!!

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.