Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello Folks,
I am looking for YTD and LYTD DAX based on define fiscal year
E.g,Current year YTD (Fiscal Year) :- 1st Sept 2017 - 31 Aug 2018 Sum of Sales data
Last tear LYTD (Fiscal Year) :- 1st Sept 2016 - 31st Aug 2017 Sum of Sales data
Thanks In Advance
Solved! Go to Solution.
LYTD = VAR DataMaxDate = CALCULATE ( MAX ( Data[Date] ), ALL ( Data ) ) RETURN CALCULATE ( [YTD], SAMEPERIODLASTYEAR ( DATESBETWEEN ( Date[Date], BLANK (), DataMaxDate ) ) )
This above DAX is working fine...
In DAX, you can specify the year end date in TOTALYTD() function.
YTD =TOTALYTD(SUM(InternetSales_USD[SalesAmount_USD]),DateTime[DateKey], ALL('DateTime'), "6/30")
For last year YTD, you can add SAMEPERIODLASTYEAR() in CALCULATE().
LYTD = CALCULATE ( TOTALYTD ( SUM ( InternetSales_USD[SalesAmount_USD] ), DateTime[DateKey], ALL ( 'DateTime' ), "6/30" ), SAMEPERIODLASTYEAR ( DateTime[DateKey] ) )
Regards,
LYTD = VAR DataMaxDate = CALCULATE ( MAX ( Data[Date] ), ALL ( Data ) ) RETURN CALCULATE ( [YTD], SAMEPERIODLASTYEAR ( DATESBETWEEN ( Date[Date], BLANK (), DataMaxDate ) ) )
This above DAX is working fine...
Hi @Josh_BI_UK,
Hi Below you will find a link to a great time intelligence post by Marco Russo and Alberto Ferrari, two of the best!
Proud to be a Super User!
Oh wow, very comprehensive. Might take while for me to get my head around all of it, but it's certainly covers the bulk of day, month, quarter, and year comparisons type functions one might have using DAX formulas. Big thanks to @richbenmintz and of course Marco Russo and Alberto Ferrari.
Hi Below you will find a link to a great time intelligence post by Marco Russo and Alberto Ferrari, two of the best!
Proud to be a Super User!
not clear where you are now as a starting point, i.e. have you set up a Date table that includes column(s) for your organization's fiscal year values?
Well I am finding Year to date sales based on Fiscal year (1st Sept 2016 to 31st Aug 2017) not (1st Jan 2017 to 31st Dec) and
LYTD (1st Sept 2015 to 31st Aug 2016)
So here Todays date is 30th Aug 2017 then I would like to calculate
Sales YTD From date 1st Sept to 2016 to 30 Aug 2017
and LYTD From date 1st Sept to 2015 to 30 Aug 2016
Now I think its more clear so if you have any idea pls provide some dax ref or calculation.
Thanks
Did you reiview the post in the link i provided, it is an excellent resource for this problem. without knowing what your date dimension and model looks like it is not very easy to provide you with a formula
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |