The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a date slicer that selects the month. Every month I go in and change the default to include all months up to the current month. So in March, the default for the slicer has January, February, and March included. I change the slicer default manually each month. I'm wondering if there is a DAX statement that can make the filter automatically select all months up to and including the current month. Thanks!
The slicer can be made to automatically choose all months up to and including the current month by using a DAX statement, yes. To accomplish this, you must create a calculated column that first determines the current date using the TODAY() function and then returns the month of the current date using the MONTH() function. Then, using the FILTER() method, you can choose all entries with a month that is less than or equal to the one you are currently seeing. Last but not least, you can utilize this calculated column as the slicer's filter.
@Anonymous , I doubt that. You need a column like this in your table
if( month([Date]) <= month(today()), "Less than Current Month", format([date],"mmmm") )
and use that in filter
User | Count |
---|---|
10 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
22 | |
14 | |
14 | |
9 | |
7 |