Forum Discussion
Default value in Report Filter Panel
- 10 years ago
Hi szenatti,
Currently, we are not able to set Report level filter based on current month directly, as DAX is not available in Report Level filter panel. To workaround the issue, we can create a calculated column via expression below:
Column = IF(MONTH(Table1[Date])=MONTH(NOW()) && YEAR(Table1[Date])=YEAR(NOW()),"current month","")
Then drag this column field to Report Level filter panel, check "current month" as default. You can also drag the Country field to Report Level Filter, then check a prefer value as default.
The way is similar to the method in this article: Finding the Latest Date in Power BI Desktop.
If you have any question, please feel free to ask.
Best Regards,
Qiuyun Yu
It works fine, but what if user wants to see the data of previous month ? I mean after publishging the dashboard how user can remove this filter if It is a page level filter?
Since this column is a conditional formating, just replace the "else" condition for the month for the date field:
Column = IF(MONTH(Table1[Date])=MONTH(NOW()) && YEAR(Table1[Date])=YEAR(NOW()),"current month",MONTH(Table1[Date]))