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
PBIuser73
Helper I
Helper I

Slicer between two values, but only for the values in dimension

Hi.
I am simplifying the problem a bit more than it actually is. 
I have a table, Period. This has the following content (It is an integer. One value for each month, pluss 00 period. If necessary, I can convert it to text.):

Period:
202400
202401
202402
202403
202404
202405
202406
202407
202408
202409
202410
202411
202412
202500
202501
202502
202503
202504
202505
202506
202507
202508
202509
202510
202511
202512

 

I want to create a slicer that allows me to select Period From and Period To. When I use the slicer in Power BI, it creates all values from: 202400 to 202512. Not just the 26 values I have in my table.So it creates:202413, 202414, 202415 etc.

And these are periods that do not exist.
Someone that has a solution?

6 REPLIES 6
ryan_mayu
Super User
Super User

@PBIuser73 

I think that's by design and we don't have a direct solution for that. 

For me, the workaround  I i will use is to create a rank column and use that rank column to filter and display the start and end period beside the filter

 

11.png

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thank you for answer. Is it possible to have the period number inside the "range visual"?
I have many other filters in report, so it will take a lot of space with those extra visuals

 

Hi @PBIuser73 

If you have a "Date" table, you can create a custom column like:
PeriodLabel = "Period " & FORMAT('Date'[Date], "MM") & " - " & FORMAT('Date'[Date], "MMM")
This will generate values like: ,
Period 04 - Apr Period 05 - May
, etc.
Then use this column in a dropdown or list slicer this takes much less space than separate visuals and helps with filtering.

Thanks for answer. I have a date table. But a field like this will be a text value. And i am not able to make between slicer? I need to have all transactions between two periods. 

MasonMA
Impactful Individual
Impactful Individual

@PBIuser73 

 

Hi, The issue appears when the slicer is treated as a continuous numeric range, specifically/only in a “Between” slicer on a numeric column. as in below picture when i tried to replicate your issue, if i use 'Text' format or change the Slicer style to Dropdown/list, the slicer is treating values as categorical and you will not see the issue anymore. 

MasonMA_0-1752150571597.png

But if you prefer to use this 'Between' Style Slicer, you'd need to create 2 separate table like below and use them in 2 different slicers, one for 'Period From' , the other for 'Period To'.

PeriodFrom = DISTINCT(SELECTCOLUMNS('Table', "Period", 'Table'[PeriodText]))

PeriodTo = DISTINCT(SELECTCOLUMNS('Table', "Period", 'Table'[PeriodText]))

MasonMA_1-1752150939132.png

and create another DAX measure to filter your fact table with below DAX.

SelectedPeriodFrom = SELECTEDVALUE('PeriodFrom'[Period])
SelectedPeriodTo   = SELECTEDVALUE('PeriodTo'[Period])

Filtered Measure =
CALCULATE (
    [Measure],
    FILTER (
        FactTable,
        FactTable[Period] >= SelectedPeriodFrom &&
        FactTable[Period] <= SelectedPeriodTo
    )
)

But again, this can only be used in 2 separate dropdown/list slicers, one for 'Period From', the other one for 'Period To'.

If in your situation, i would simply change them to 'Text' format and use Dropdown/List style in Slicer. 

Hope it helps. 

Hi. Thanks for answer. For this solution you have to make a measure in fact table for this? Because then i have to duplicate fields. The date i showed you were one of to "time" dimensions in the model. I have totaly 2. One "dim.date" and one "dim.period" (that is the one i showed you)

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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