Forum Discussion
bettysmile
3 years agoRegular Visitor
calculate Date filter SAMEPERIODLASTYEAR
Hello, i have a calculate Date filter like this: VAR Last month = SELECTCOLUMNS(ADDCOLUMNS( CALCULATETABLE( 'Datum (D)', FILTER(ALLNOBLANKROW('Datum (D)'[Datum]), YEAR('D...
KVRKarthik
3 years agoFrequent Visitor
Hi,
In the variable "Last Month", the table calculation is
CALCULATETABLE(
'Datum (D)', FILTER(ALLNOBLANKROW('Datum (D)'[Datum]), YEAR('Datum (D)'[Datum]) = YEAR(TODAY()) && MONTH('Datum (D)'[Datum])+1 = MONTH(TODAY())
As per this function, if MONTH(TODAY()) = "August" and YEAR(TODAY()) = 2023 then the Datebe[Datum] will have dates of 2023 and July Month.
When the calculation is limited to current year and current year's previous month then this table cannot support you to navigate to same period last year.
If you need to execute SAMEPERIODLASTYEAR in your presentation then please revise your filtering conditions in a new measure as
YEAR('Datum (D)'[Datum]) = YEAR(TODAY()) - 1 && MONTH('Datum (D)'[Datum])+1 = MONTH(TODAY())
YEAR('Datum (D)'[Datum]) = YEAR(TODAY()) - 1 && MONTH('Datum (D)'[Datum])+1 = MONTH(TODAY())
Hope this helps in resolving your issue.
Regards,
Karthik.
Karthik.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.