Forum Discussion
YTD weekly calculation
- Anonymous2 years ago
Hi amitchandak
My mistake. Relationship between Date Table and my date column was not OK. Now seems to be working .
Thanks a lot amitchandak
Anonymous , Based on what I got, Have date table, joined it with Date part of your datetime column.
If needed create a table in you column
Date = Datevalue([datetime Column]) // join with date of date table
Have week created column in date table
Have these new columns in Date Table, Week Rank is Important in Date/Week Table
Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
WeekDay = weekday([Date],2)
Use them in visual
And use measure
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
- Anonymous2 years agoNot applicable
Hi amitchandak
Thanks a lot , but it´s not working.
The measure is given me the Running Total up to now, but when adding to a visual a putting the weeks in the colum visual table , it keps giving the down time by week instead of the running total until each week.... so I have the same wrong calculation, YTD for each week not the running total YTD.
Please see the difference between Power BI calculations and Excel calculations
BR
- Anonymous2 years agoNot applicable
Hi amitchandak
My mistake. Relationship between Date Table and my date column was not OK. Now seems to be working .
Thanks a lot amitchandak