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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
mostho
Helper II
Helper II

in between / less than slicer with month names instead of month numbers

I need a matrix visual with months as columns and the reader of the report should be able to select the range, for example january to march, or january to july. this works fine for me with an in between  / less the slicer using month of year as data field. (i have a facttable and a datetable with an active relationsship)

Now i was asked if its possible to have a default value (current month) for the slicer. I know that an in between/ less than slicer works only with numerical values or dates not with text.

With text (month names) i know how to do the current value as default value for the slicer with renaming the current month name as (e.g.) "default". But then there is only one column (the current month) in the matrix visual.

Any ideas how to get a possibiltiy for a default month in the slicer in the meaning of (january to current month) and having all the months in the matrix visual?

I would be fine with a numerical solution (in between/less than) with a default value and i would also be fine with a solution with mont names if the selection would be as "january to " interpreted.

4 REPLIES 4
Anonymous
Not applicable

Hi, @mostho 

Maybe you can add a month number column to make sure your date table has a column of month numbers

MonthNumber = MONTH([Date])

Use this column for slicer

vyohuamsft_0-1721712463435.png

Power BI doesn't currently support out-of-the-box dynamic default slicer values, but you can use bookmarks and buttons to emulate this behavior. Create a bookmark with the slicer set to the current month, and then use the button to navigate to this bookmark.

vyohuamsft_1-1721712539177.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

Samarth_18
Community Champion
Community Champion

Hi @mostho ,

 

Based on the description, this code could help:-

CurrentMonthSelection = 
VAR CurrentMonth = SELECTEDVALUE('Date'[Month of Year])
RETURN
    IF(
        CurrentMonth = "January", "January",
        IF(
            CurrentMonth = "February", "January to February",
            IF(
                CurrentMonth = "March", "January to March",
                IF(
                    CurrentMonth = "April", "January to April",
                    IF(
                        CurrentMonth = "May", "January to May",
                        IF(
                            CurrentMonth = "June", "January to June",
                            IF(
                                CurrentMonth = "July", "January to July",
                                IF(
                                    CurrentMonth = "August", "January to August",
                                    IF(
                                        CurrentMonth = "September", "January to September",
                                        IF(
                                            CurrentMonth = "October", "January to October",
                                            IF(
                                                CurrentMonth = "November", "January to November",
                                                IF(
                                                    CurrentMonth = "December", "January to December",
                                                    BLANK()
                                                )
                                            )
                                        )
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Ritaf1983
Super User
Super User

Hi @mostho 
Can you show what do you mean?

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Okay, lets do it. I have a fact table:

countryclientdateamount
usaA10.06.202410
canadaB15.07.202414
argentinaC02.02.202416
usaB02.02.202417


and a date table (this is only a part of the whole table):

DateMonthNumberMonthNameMonthNameCurrent
28.06.2024 00:00:006JuneJune
29.06.2024 00:00:006JuneJune
30.06.2024 00:00:006JuneJune
01.07.2024 00:00:007Julycurrent
02.07.2024 00:00:007Julycurrent
03.07.2024 00:00:007Julycurrent
04.07.2024 00:00:007Julycurrent
05.07.2024 00:00:007Julycurrent


There is an active relationship via the date-colums.


If I use an in between/less than slicer with the MonthNumber and a matrix visual with country and client as rows, MonthName as column and amount as value I get this:
pic1.jpg

Which is ok, but it would be fine if the month (here: 6) would alway be the current month as preselected value.

If I use a text slicer with MonthNameCurrent I would have always the current month selected (thats fine) but then there is also only the current month in the matrix visual:
pic2.jpg
What i need:

the matrix visual like in the first picture and a possiblilty to select a month range like in the first picture but it should be able to have a current default month like in the second picture.

If the solution uses monthnumbers or monthnames doesnt matter.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors