I need to calculate Previous Fiscal Year to date vs Current Fiscal Year to date.
Right now I have Fiscal YTD by:
Solved! Go to Solution.
Please try this..
Create a variable and use it for previous year.
Var a = PARALLELPERIOD('Calendar Table'[Date],-1,YEAR)
Fiscal PYTD Net Sales = totalytd(sum(VDC_EDW[Net_Sales_Amount]),a,"3/31")
If this helps, mark it as a solution.
kudos are nice too.
Hi @VasTg ,
Thanks for the quick response.
I'm not quite sure how to use the first one as I am not well versed in variables.
I tried the second one:
Please try this..
Any reason for not having period end date for last year.
These should work. Also make sure Date table is marked as Date in Data view
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"3/31")) Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"3/31")) Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"3/31"))
Hi @tstackhouse ,
Maybe this measure can help you:
Measure 2 = CALCULATE( SUM(Sales[Sales]), DATESYTD(SAMEPERIODLASTYEAR(Date[Date]), "3/31") )
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I have tried all the possible solution mentioned in this Post , to get the YTD for previous year. It is not working for me.
It seems Date Table is not able to filter the Sales Date. I have used [Date] from Date Table in DAX Query.
Also, Date Table is marked as Date Table. There is a 1 to Many relationship between Date Table and Sales Table
Here is how I created Date table
Does your sales date is having timestamp. If so then date join might noe working properly.
Create date column
Sales Dt =[Sales Date].date
Can you share sample data and sample output.
@amitchandak Yes, you pointed out right. All my dates in fact tables are with timestamp.
But, I already converted the date format to mm/dd/yyyy, in power view but not in power query
Also, the language setting for my PowerBI and my laptop is english (US), so to avoid date confusion.
But, Let me try with your suggestion . Thanks Amit
It’s time for another PBI Community recap!
Visit our Community Blog for articles, guides, and information created by fellow community members.
Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.
Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!