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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
venkateshlprabu
Regular Visitor

Date Range "Between" Slicer Values to Advance Editor

I am trying to get the Date Range "Between" slicer min and max values selected in the Query in the advanced editor in the Direct Query to use in Where condition in SQL.

 

I know I can have two separate filters for start date and End date and get those values, but end users doesn't want a drop down for a date range. 

 

Any ideas anyone ? 

9 REPLIES 9
venkateshlprabu
Regular Visitor

Hi @lbendlin ,

Thanks for the reply. This solution works fine for the non date data types. 

 

But I am seeing this issue specifically for the Date type when you use the "Between" option. When you use the Between option you won't even be able to assign a parameter to the data table.

Why not?  You should be able to use MIN and MAX against your Between range.

I am able to get those values in a Measure and see. But I need those values to be sent to my direct query through a parameter so I can use them in the WHERE clause. 

as I said, in Power Query use List.Min and List.Max against that parameter  when you compose the SQL query.

I tried assigning a parameter to my independent Date table and added a slicer with the "Between" option and binded the parameter. When I change the slicer I get the error as "An incompatible filter is used on a column with a parameter mapping"

Don't have access to a Direct Query data source at the moment. Will test tomorrow.

 you are right, "between"  filters are not supported. 

Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn

Unsupported filters

  • Relative time slicer or filter
  • Relative date
  • Hierarchy slicer
  • Multifield include filter
  • Exclude filters / Not filters
  • Cross-highlighting
  • Drilldown filter
  • Cross drill filter
  • Top N filter

@venkateshlprabu

 

Picking individual values does still work. You would have to modify the SQL to use IN rather than BETWEEN. Or you can let Power Query do the work for you

 

let
    DateList = if Type.Is(Value.Type(DateRange),List.Type) then DateRange else {DateRange},
    Source = Sql.Database(server,database),
    dbo_Dates = Source{[Schema="dbo",Item="Dates"]}[Data],
    #"Filtered Rows" = Table.SelectRows(dbo_Dates, each List.Contains(DateList,[date]))
in
    #"Filtered Rows"

results in a folding query.

Let me try this and get back to you. Thanks for your help @lbendlin 

lbendlin
Super User
Super User

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.