Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello,
I think the title says it all! So a DAX command with time intelligence which starts not on jan 1st like YTD but another 1st of a month. And which calculates a running total on a daily basis. And starting again after a full year.
Thanks!
Solved! Go to Solution.
There is a DAX function DATESYTD which accepts an optional year end date parameter that you could likely use in this scenario.
Here is a link to the learn doc. Learn - DATESYTD
Proud to be a Super User! | |
Hello @Artefact,
Can you please try the following approach:
RunningTotalSep1 =
CALCULATE(
[Total Sales],
FILTER(
ALL('Date'),
'Date'[Date] >= DATE(YEAR(TODAY()) - IF(MONTH(TODAY()) < 9, 1, 0), 9, 1) &&
'Date'[Date] <= MAX('Date'[Date])
)
)
Hope this helps.
@Artefact - You don't understand.
In DATESYTD( ) think of the end date that you set in the code as setting a static start date. You just give it the day before you want your YTD to start. You are just setting a static end to the previous year.
The end date of your current year will then be dynamic when you use a slicer etc.
Thanks, but I want the end date to be dynamic, with a slicer. And the parameter you mentioned must be static.
@Artefact - The solution provided by @jgeddes will be dynamic, because you will set the year end date to 31/08, which will mean your YTD calculation always begins at 01/09 and runs to current date.
An example of how you will use this is below:
CALCULATE( [Total Sales], DATESYTD('Date'[Date]', "08-31") )
You will need to make sure you use the correct format for your Date Locale.
I want the end date to be dynamic, and not limited to one date like 31/08. I want the customer to choose th end date. Based on a parameter or selection.
There is a DAX function DATESYTD which accepts an optional year end date parameter that you could likely use in this scenario.
Here is a link to the learn doc. Learn - DATESYTD
Proud to be a Super User! | |
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
14 | |
14 | |
11 | |
8 |