Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I am looking to create a YTD formula (and Prior Year YTD). I've tried a few different variations of TOTALYTD and DATESYTD which have not worked. They end up giving me the full year values instead of a true YTD. I'm assuming this is because my visuals do not have a date axis. I also should mention I have a date table that includes 2023, 2024 and 2025 for historical and forecasting purposes in case that is relevant to the formula.
I have successfully created current quarter and full year formulas that do not require me to filter on the visual itself. i'd like to create the same with the YTD formulas if possible, but am fine with filtering to the current year if needed.
here is my matrix table (numbers removed) of my full year summary as example:
here is my full year formula for example:
Solved! Go to Solution.
Try this:
Current YTD Budget =
CALCULATE (
SUM ( 'vCorporateGandA'[Amount] ),
FILTER (
ALL ( 'CalendarTable' ),
YEAR ( 'CalendarTable'[Date] ) = YEAR ( TODAY () )
&& 'CalendarTable'[Date] <= TODAY ()
),
'vCorporateGandA'[LedgerType] = "Budget"
)
There are lots of options including time intelligence functions like PARALLELPERIOD, DATEADD, or PREVIOUSYEAR.
You can also do it more directly but a bit ugly like this:
Prev YTD Budget =
CALCULATE (
SUM ( 'vCorporateGandA'[Amount] ),
FILTER (
ALL ( 'CalendarTable' ),
YEAR ( 'CalendarTable'[Date] ) = YEAR ( TODAY () ) - 1
&& 'CalendarTable'[Date] <=
DATE (
YEAR ( TODAY () ) - 1,
MONTH ( TODAY () ),
DAY ( TODAY () )
)
),
'vCorporateGandA'[LedgerType] = "Budget"
)
Try this:
Current YTD Budget =
CALCULATE (
SUM ( 'vCorporateGandA'[Amount] ),
FILTER (
ALL ( 'CalendarTable' ),
YEAR ( 'CalendarTable'[Date] ) = YEAR ( TODAY () )
&& 'CalendarTable'[Date] <= TODAY ()
),
'vCorporateGandA'[LedgerType] = "Budget"
)
this worked! how can i get this for prior year as well?
There are lots of options including time intelligence functions like PARALLELPERIOD, DATEADD, or PREVIOUSYEAR.
You can also do it more directly but a bit ugly like this:
Prev YTD Budget =
CALCULATE (
SUM ( 'vCorporateGandA'[Amount] ),
FILTER (
ALL ( 'CalendarTable' ),
YEAR ( 'CalendarTable'[Date] ) = YEAR ( TODAY () ) - 1
&& 'CalendarTable'[Date] <=
DATE (
YEAR ( TODAY () ) - 1,
MONTH ( TODAY () ),
DAY ( TODAY () )
)
),
'vCorporateGandA'[LedgerType] = "Budget"
)
any chance you can whip up a QTD and PY QTD formula too?
You can use the YTD ones and include another condition for the quarter like you have in your original post.
For example,
Current QTD Budget =
CALCULATE (
SUM ( 'vCorporateGandA'[Amount] ),
FILTER (
ALL ( 'CalendarTable' ),
YEAR ( 'CalendarTable'[Date] ) = YEAR ( TODAY () )
&& QUARTER ( 'CalendarTable'[Date] ) = QUARTER ( TODAY () )
&& 'CalendarTable'[Date] <= TODAY ()
),
'vCorporateGandA'[LedgerType] = "Budget"
)
Hi Alexis,
Could you adjust this formula to start the month prior? For example, I will be refreshing the file on February 5th to report on January. Values for February are entered, but we don't want them reflected in the QTD formula until month end in March.
This worked as well, thank you! 🙂
User | Count |
---|---|
84 | |
71 | |
71 | |
68 | |
55 |
User | Count |
---|---|
94 | |
92 | |
91 | |
77 | |
70 |