Forum Discussion
BoBBie
7 years agoFrequent Visitor
ytd multipe years
I have a database with all sales data from 2012 (inclusing a seperate date table). I want to display the sales orders amount of current year to date (data is updated / synct daily) including all prev...
- 7 years ago
solved by searching the community YTD untill today thanks to OwenAuger
YTD Values till last orderdate = VAR LOD = [Last Order Date] VAR TodayMonth = MONTH ( LOD ) VAR TodayDay = DAY ( LOD ) VAR YearDateFilter = GENERATE ( VALUES ( 'date table'[year] ); VAR TodayInCurrentYear = DATE ( 'date table'[year] ; TodayMonth; TodayDay ) RETURN CALCULATETABLE ( DATESYTD ( 'date table'[Date] ); TREATAS ( { TodayInCurrentYear }; 'date table'[Date] ) ) ) RETURN CALCULATE ( DISTINCTCOUNT(Blad1[orderno]); KEEPFILTERS ( YearDateFilter ) )and
YTD-PY values till last order date = CALCULATE([YTD Values till last orderdate];SAMEPERIODLASTYEAR('date table'[Date]))
BoBBie
7 years agoFrequent Visitor
Hi parry2k,
thanks for help!
Unfortenately is is not working correctly.....
I think the solution is a filter for all years (current and previous years) in the month and day of the latest orderdate......
The Y-1 is only for visual comparison in the column chart...
I'm new with PBI & DAX so it's a bit trial and error (a).
BoB