Forum Discussion
Current month as default - slider
- 3 years ago
HI danielwhitmote ,
Make sure that you have an entry in your Custom Date table for the Year Month in the format 'YYYY-MM'. Make sure you use a leading zero for the month part so it's always two digits like '2019-03'.
Once that's in place create this column using DAX:
Report Month = IF(MONTH(now()) = Month(DB_DIM_Dates[Date]) && YEAR(now()) = YEAR(DB_DIM_Dates[Date]), "Current Month", DB_DIM_Dates[Year-Month])This will set each day for the current month to 'Current Month' and every other date to their respective Year-Month setting. Add this to a slicer, make it list view and sort descending and as 'Current Month' comes last alphanumerical it appears at the top of the list. 'Current Month' can always be your default value with others available to select. This means that when you subscribe it will happily roll over into a new month etc. You can modify this approach for any date range etc you are interested in.
refer:
Solved: Current month default selection in Slicers, so tha... - Microsoft Power BI Community
Solved: Slicer to select current month as default - Microsoft Power BI Community
Best Regards
Lucien
when no month is selected
I using something like this however it still doesnt ruturn acceptable result
- FreemanZ3 years ago
Super User
try this:
NCM Monthly: =IF(ISFILTERED ('Date'[Month Name]),CALCULATE(DISTINCTCOUNT ( SNC[NCM] )),CALCULATE (DISTINCTCOUNT ( SNC[NCM] ),FITER(ALL(SNC),MONTH(SNC[DATE])=MONTH(TODAY()))))- danielwhitmote3 years agoFrequent Visitor
This one assigns same NCM count to all months.