Forum Discussion
JakubHa
9 years agoFrequent Visitor
Last 3 Months Slicer
Hi, I`m trying to create a Slicer with Last Month, Last 3 months and Overall. I tried one Dax formula described here: Power BI – Time Period Slicer for Last 7 Days,Last 30 Days.. – Analytics A...
Anonymous
9 years agoNot applicable
Add a new column in Power Query (Query Editor):
= Table.AddColumn(YOURLASTSTEP, "MonthDiff", each (Date.Year([Date])-1)*12+Date.Month([Date]) - ((Date.Year(DateTime.LocalNow())-1)*12+ Date.Month(DateTime.LocalNow())) )
The code calculates the differenz between today and the date in your column in months.
Then you'll use this new column as a slicer.
Hope this helps.
JakubHa
9 years agoFrequent Visitor
Hello Anonymous,
I`ve got this error: "Expression.Error: The name 'YOURLASTSTEP' wasn't recognized. Make sure it's spelled correctly."
Appreciate your help,
Jakub
- Anonymous9 years agoNot applicable