Forum Discussion
Add last month closed flag in DAX or Power Query
- 5 years ago
You can add this column to your Date table and then filter on "Y" to see only closed months.
Closed Month = if(EOMONTH('Date'[Date],0) <= TODAY(), "Y", "N")Regards,Pat
Anonymous , You can use YTD with date table and force it stop at last month
LYMTD QTY forced=
var _dt = eomonth(today(),-1) // Or // maxx(allselected(Date),Date[Date])
return
if('Date'[Date]<=_max,CALCULATE(Sum('order'[Qty]),DATESYTD(dateadd('Date'[Date],-1,year))), blank())
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
- Anonymous5 years agoNot applicable
Hi amitchandak , thanks for yo answer.
My idea is to add a flag in a page filter, but not for a measure. I wanted to know if it is possible to define this in my calendar dimension either in DAX or Power Query.
Regards!
- mahoneypat5 years ago
Microsoft Employee
You can add this column to your Date table and then filter on "Y" to see only closed months.
Closed Month = if(EOMONTH('Date'[Date],0) <= TODAY(), "Y", "N")Regards,Pat- Anonymous5 years agoNot applicable
Thanks mahoneypat !