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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
LuisJ
New Member

how to assing a default values to a numeric range slicer

i everyone, i'm leaning power bi and i have been searching about how do the next:

 

i have a dropdown slice that is configurate by type of date

LuisJ_0-1663792550382.png

 

and a numeric range slice based in the same date data 

LuisJ_1-1663792628722.png

 

i want to know if is posible to if i select for example a "last year" and the numeric range slice take the range values but doesn't lost the dates before, i mean:

 

take the date between 21/09/2021 and 21/09/2022 

LuisJ_2-1663792791190.png

 

and in this case can choose dates before 21/09/2022 like 29/08/2022 or older

LuisJ_3-1663792855655.png

 

and change the date type to "custom" if other date is selected

 

i appreciate if someone can help me, i'm starting, i don't know if this is easy or hard, thanks a lot

 

 

2 REPLIES 2
LuisJ
New Member

@Greg_Deckler thanks for you help, but maybe i explained it bad, 

my configuration is 

 

i have a table (Dim_date) with dates from Ene-01-2000 and Dic-31-2030, and a table with name "Date_Range" that contains the dates by types

LuisJ_1-1663867185506.png

and the two slicer are based on Date_Range

LuisJ_2-1663867787361.png

 

but when i select a date, the previously date are disable 

LuisJ_3-1663867913707.png

so that i want is 

1) when custom is select keep the last range selected ( by type )

previous selected last 7 days

LuisJ_4-1663868265427.png

next only in the case if select custom keep the previous date, for example

LuisJ_5-1663868362156.png

 

2) when is selected any type take the range but don't disable the previously 

 in my case, the things in the line green are disable

LuisJ_6-1663868456511.png

i want 

LuisJ_7-1663868637718.png

 

is like to assign a value to slicer, i don't know if it is possible 

 

 

 

 

Greg_Deckler
Community Champion
Community Champion

@LuisJ Is your type slicer coming from a disconnected table? Please confirm if I understand correctly. You want to be able to choose something in your type slicer and use that instead of the range values but you don't want the range values to change from what the user may have selected. If you choose custom, then use the values in the range slicer. Is that all correctly stated? If that is what you want, use a disconnected table for your type slicer and then something along the lines of:

Measure =
  VAR __type = SELECTEDVALUE('DisconnectedTable'[Value])
  VAR __Min = MIN('Dates'[Date])
  VAR __Max = MAX('Dates'[Date])
RETURN
  SWITCH(__type,
    "custom",SUMX(FILTER('Table',[Date] >= __Min && [Date] <= __Max),[Value]),
    "Last 30 Days", [Last 30 Days Measure],
    "Last 7 Days", [Last 7 Days Measure],
...
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.