Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have a calendar table with fields Date, Year(Calendar), and Year(Fiscal). I need a measure that will return the date range logic as follows, but I can't figure out the proper syntax:
Dates between:
Min(Calendar[Date] where Year(Fiscal) = same Year(Fiscal) as today) and
Calendar[Date] = today()
So if the start of current FY = 4/1/21, the date range it would return is 4/1/2021 - 5/6/2021. Thoughts for as compact of dax as possible?
Hi @Anonymous
Sorry I missed fiscal year thingy
Could you try following formula
DatesYTD-Fiscal =
var cur = Today()
VAR StartDate = DATE ( Year(cur), 4, 1 )
VAR EndDate = cur
RETURN
DATESBETWEEN ( 'Date'[Date], StartDate, EndDate )
ORDER BY [Date]
Regards,
Sayali
Proud to be a Super User!
I am unable to run because I can't get syntax right for how it fits into a measure, but just looking at it seems like it's not going to be right because it's looking at the year of today. So, theoretically it works when we're in the months where Calendar and Fiscal year numbers are the same, but January of next year is not going to work.
Hi
You can use the following DAX Formule. It will return the table with dates you are looking for
DatesYTD =
CALCULATETABLE (
DATESYTD ( 'Date'[Date] ),
'Date'[Date] = TODAY ()
)
Regards,
Sayali
If this post helps, then please consider Accept it as the solution to help others find it more quickly
Proud to be a Super User!
How does that fit in to checking that the date is based on the current Fiscal year?
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |