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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Jilani
Regular Visitor

Power Bi Slicer By Default Current Month

HI Team,

I am having Year and Month Slicer as shown below, when i am publishing this dashboard to server i am selecting current mont and publishing.

But for next month i need to select the current month and then has to republish .

Can you please help me every month the slicer can update with current month.

 

Please see the attachment i am giving the sample data how my slicer looks like.

See below i Published for october still its showing octber if current month changes slicer has to update.

Jilani_1-1699168116706.png

 

Jilani_2-1699168139817.png

 

Jilani_3-1699168187563.png

 

 

1 ACCEPTED SOLUTION

Hi @Jilani ,

 

Your demand is a good idea, while it is not supported to implement in Power BI currently.
You can vote up this idea for this function:Microsoft Idea
Or you can submit a new idea to improve the Power BI.
It is a place for customers provide feedback about Microsoft Office products . What’s more, if a feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

 

Here I will show you a workaround to achieve your goal. I think it is better for you to change the data type for columns in 'Date' table like [DateKey]/[Year]/[Month] to whole number,[Date] to date and so on.

Then add an unrelated table for slicer.

Date for Slicer = SUMMARIZE('Date','Date'[Year],'Date'[Month],"YearMonth",[Year]*100+[Month])

Measure:

Filter = 
VAR _SELECTYEARMONTH =
    VALUES ( 'Date for Slicer'[YearMonth] )
RETURN
    IF (
        ISFILTERED ( 'Date for Slicer'[Month] ),
        IF (
            MAX ( 'Date'[Year] ) * 100
                + MAX ( 'Date'[Month] ) IN _SELECTYEARMONTH,
            1,
            0
        ),
        IF (
            MAX ( 'Date'[Year] ) * 100
                + MAX ( 'Date'[Month] )
                = YEAR ( TODAY () ) * 100
                    + MONTH ( TODAY () ),
            1,
            0
        )
    )

Add this measure into visual level filter and set it to show items when value = 1.

vrzhoumsft_0-1699339827402.png

vrzhoumsft_1-1699339857581.png

 

Best Regards,
Rico Zhou

 

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

 

 

View solution in original post

2 REPLIES 2
Jilani
Regular Visitor

HI Team,

I am having Year and Month Slicer as shown below, when i am publishing this dashboard to server i am selecting current mont and publishing.

But for next month i need to select the current month and then has to republish .

Can you please help me every month the slicer can update with current month.

 

Please see the attachment i am giving the sample data how my slicer looks like.

See below i Published for october still its showing octber if current month changes slicer has to update.

 

 

Jilani_1-1699168704820.png

 

 

Jilani_2-1699168704860.png

 

 

 

https://drive.google.com/file/d/1-Hs786gJKP279IFV5ZBmCExZZ5xEC5UJ/view?usp=sharing

 

Sharing the sample Data Link As well

Hi @Jilani ,

 

Your demand is a good idea, while it is not supported to implement in Power BI currently.
You can vote up this idea for this function:Microsoft Idea
Or you can submit a new idea to improve the Power BI.
It is a place for customers provide feedback about Microsoft Office products . What’s more, if a feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

 

Here I will show you a workaround to achieve your goal. I think it is better for you to change the data type for columns in 'Date' table like [DateKey]/[Year]/[Month] to whole number,[Date] to date and so on.

Then add an unrelated table for slicer.

Date for Slicer = SUMMARIZE('Date','Date'[Year],'Date'[Month],"YearMonth",[Year]*100+[Month])

Measure:

Filter = 
VAR _SELECTYEARMONTH =
    VALUES ( 'Date for Slicer'[YearMonth] )
RETURN
    IF (
        ISFILTERED ( 'Date for Slicer'[Month] ),
        IF (
            MAX ( 'Date'[Year] ) * 100
                + MAX ( 'Date'[Month] ) IN _SELECTYEARMONTH,
            1,
            0
        ),
        IF (
            MAX ( 'Date'[Year] ) * 100
                + MAX ( 'Date'[Month] )
                = YEAR ( TODAY () ) * 100
                    + MONTH ( TODAY () ),
            1,
            0
        )
    )

Add this measure into visual level filter and set it to show items when value = 1.

vrzhoumsft_0-1699339827402.png

vrzhoumsft_1-1699339857581.png

 

Best Regards,
Rico Zhou

 

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

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.