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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
adrianPadurariu
Resolver I
Resolver I

Default slicer with current month

Hi, everyone!

 

I have this measure that works only with a selected slicer with (Month). This slicer should be every month selected with the current month.

DbD BV LY =
VAR workingdays = MAX('Calendar'[MTD workday column])
VAR Vmonth = MAX('Calendar'[Date].[Month])
VAR Previous = MAX('Calendar'[Date].[Year])-1
RETURN
CALCULATE(
    TOTALMTD(
        SUM('GLD_BON DAILY_FLASH_REPORT'[TotalFacialValue]),
        'Calendar'[Date]
    ),
    FILTER(ALL('Calendar'),
        'Calendar'[Date].[Month]=Vmonth && 'Calendar'[MTD workday column]=workingdays && 'Calendar'[Date].[Year]=Previous)
    )
/1000
 

There are a few methods for doing this on the internet but with some modifications to the Month Column (like default or today), and my measure will not work with these methods.

So I will need a solution to either modify the slicer or the measure.

adrianPadurariu_0-1698913296762.png

 

2 REPLIES 2
123abc
Community Champion
Community Champion

o make your measure work with a slicer that always defaults to the current month, you can modify the slicer or the measure itself. Here, I'll provide you with a solution that modifies the measure to achieve this:

You can modify your measure to automatically calculate the current month without relying on the slicer selection. You can use the TODAY() function to get the current date and extract the month from it. Here's how you can modify your measure to achieve this:

 

DbD BV LY =
VAR workingdays = MAX('Calendar'[MTD workday column])
VAR Vmonth = MONTH(TODAY()) // Get the current month
VAR Previous = MAX('Calendar'[Date].[Year]) - 1
RETURN
CALCULATE(
TOTALMTD(
SUM('GLD_BON DAILY_FLASH_REPORT'[TotalFacialValue]),
'Calendar'[Date]
),
FILTER(ALL('Calendar'),
'Calendar'[Date].[Month] = Vmonth && 'Calendar'[MTD workday column] = workingdays && 'Calendar'[Date].[Year] = Previous)
)
/ 1000

 

By using MONTH(TODAY()) in the Vmonth variable, you're calculating the current month dynamically without relying on the slicer selection. This will ensure that your measure always works with the current month, regardless of the slicer's state.

Now, you don't need to manually select the current month in the slicer for this measure to work as expected.

 

OR Follw Link:

 

Set Default Slicer Selection to Current Year or Month in Power BI

https://www.youtube.com/watch?v=JlVHsZUk1nc

 

Default Current Month Slicer in Power BI - How to default to the current month

https://www.youtube.com/watch?v=5dN4SqufENE

 

 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

 

In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.

 

 

 

 

I get this error with this solution:

adrianPadurariu_0-1698915237368.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.