DP-500 · Question #65
You are building a Power BI dataset with a Calendar table and a calculated column pfFlag = IF ('Calendar'[Date] < TODAY(), "Past", "Future"). You need a measure for fiscal prior year-to-date for…
The correct answer is E. DATESYTD. To calculate a fiscal prior year-to-date measure for sales amount with a specific fiscal year end, the DATESYTD DAX function is the appropriate choice.
Question
pfFlag = IF ('Calendar'[Date] < TODAY(), "Past", "Future"). You need a measure for fiscal prior year-to-date for [sales Amount], with a fiscal year end of June 30, producing no result for future dates. How should you complete the DAX expression, specifically the function for year-to-date calculation with fiscal year end '6/30/2022' from the provided options?Options
- ADATEADD
- BFIRSTDATE
- CPARALLELPERIOD
- DSAMELASTPERIODLASTYEAR
- EDATESYTD
How the community answered
(60 responses)- A5% (3)
- C3% (2)
- D2% (1)
- E90% (54)
Why each option
To calculate a fiscal prior year-to-date measure for sales amount with a specific fiscal year end, the DATESYTD DAX function is the appropriate choice.
DATEADD shifts a set of dates by a specified interval and is not designed for year-to-date calculations.
FIRSTDATE returns the first date in the current filter context and is not used for aggregating year-to-date values.
PARALLELPERIOD returns a set of dates in a parallel period to the given set of dates, suitable for comparisons but not for year-to-date aggregation.
SAMELASTPERIODLASTYEAR returns a set of dates in the previous year of the same period, but it does not support custom fiscal year ends for YTD calculations.
DATESYTD (Dates, [YearEndDate]) calculates the year-to-date over the given set of dates, allowing for a specified fiscal year end, which directly matches the requirement for 'fiscal prior year-to-date' with a June 30 fiscal year end.
Concept tested: DAX DATESYTD fiscal year-to-date calculation
Source: https://learn.microsoft.com/en-us/dax/datesytd-function-dax
Topics
Community Discussion
No community discussion yet for this question.