Forum Discussion
Future dates displayed and should not be.
- 10 years ago
This is what I have
= Table.SelectRows(#"Renamed Columns1", each [Date] <= DateTime.LocalNow()
This will return PY sales if you have Net sales else will be blank
PY Sales=
IF (
NOT ( ISBLANK ( [Net Sales] ) ),
SUMX ( DimDate, CALCULATE ( [Net Sales], DATEADD ( DimDate[Date], -1, YEAR ) ) )
)
Thanks for that. I have updated the PY sales and PY orders field.
The trouble is the year, month and day slicers still show years months and days going all the way to 2020
Craig
- HarrisMalik10 years ago
Continued Contributor
CraigBlackman Can you share a screenshot with us? and secondly what type of relationship you have between your date dimension and fact?
Cheers
Harris
- CraigBlackman10 years ago
Helper III
- konstantinos10 years ago
Memorable Member
The slicers are probably from the Date table so they always list all the values that exists in Date table. There is nothing to do with measures.
You can create a 1) new Date table with caclulated tables and CALENDAR() function ( then add calculated columns) so it shows only the sales first and last dates dynamically or 2) you can filter the date table in the query when you load the Date table.
- CraigBlackman10 years ago
Helper III
konstantinos, how would I implement item 2?
- HarrisMalik10 years ago
Continued Contributor
what konstantinos means by option 2 is to import only those dates which are relevant while reading the date table from source. You can also try another option, put the date in the page level or report level filters and filter out only the periods you need but the downside is that you have to change the filter everytime you want to see the new dates.
The best option is to only read the dates which are relevant during ETL.
Regards
Harris