Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
danielwhitmote
Frequent Visitor

Current month as default - slider

I am trying to make current month to be displayed as default in my visuals.

 

I tried modyfying:

Measure = IF(ISFILTERED(Table1[Month]),CALCULATE(SUM(Table1[sales])),CALCULATE(SUM(Table1[sales]),FILTER(Table1,MONTH(Table1[Date])= MONTH(TODAY()) && YEAR(Table1[Date])=YEAR(TODAY()))))

Without sucess.

 

Data table - SNC 

 

danielwhitmote_0-1668385604727.png

 

And I also have Date table- Date

 

danielwhitmote_1-1668385678371.png

 

 My measue is:

NCM Monthly: =
    CALCULATE( DISTINCTCOUNT ( SNC[NCM] ))
 
Any help would be greatly appreciated.
1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

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.

vluwangmsft_0-1669362900583.png

 

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

View solution in original post

6 REPLIES 6
v-luwang-msft
Community Support
Community Support

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.

vluwangmsft_0-1669362900583.png

 

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

FreemanZ
Super User
Super User

How does your visual look like?

danielwhitmote_0-1668413884613.png

 

when no month is selected

danielwhitmote_1-1668413924083.png

 

I using something like this however it still doesnt ruturn acceptable result

 

NCM Monthly: =
IF(
    ISFILTERED ('Date'[Date]),
    CALCULATE( DISTINCTCOUNT ( SNC[NCM] )),
    CALCULATE (( DISTINCTCOUNT ( SNC[NCM] ),FILTER(SNC), MONTH((TODAY())))))

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())
        )
    )
)

This one assigns same NCM count to all months.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors