Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric certified for FREE! Don't miss your chance! Learn more
Hello All
how to write expression filter datesbetween startdatetime & enddatetime.
Thanks
Rs
Solved! Go to Solution.
Hi @refint650 ,
Here are the steps you can follow:
If you want to use measure to perform an aggregation operation on the values of two slicer-selected dates, you can use the following measure:
Create measure.
Measure =
var _selectstart=SELECTEDVALUE('StartDate'[StartDate])
var _selectend=SELECTEDVALUE('EndDate'[EndDate])
return
SUMX(
FILTER(ALLSELECTED('Date'),
'Date'[Order DateTime] >=_selectstart&&'Date'[Order DateTime]<=_selectend),[Rand])
If you want [Order DateTime] to show the date between two slicer selections, you can use the following measure:
Create measure.
Flag =
var _selectstart=SELECTEDVALUE('StartDate'[StartDate])
var _selectend=SELECTEDVALUE('EndDate'[EndDate])
return
IF(
MAX('Date'[Order DateTime])>=_selectstart&&MAX('Date'[Order DateTime])<=_selectend,1,0)
Place [Flag]in Filters, set is=1, apply filter.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @refint650 ,
Here are the steps you can follow:
If you want to use measure to perform an aggregation operation on the values of two slicer-selected dates, you can use the following measure:
Create measure.
Measure =
var _selectstart=SELECTEDVALUE('StartDate'[StartDate])
var _selectend=SELECTEDVALUE('EndDate'[EndDate])
return
SUMX(
FILTER(ALLSELECTED('Date'),
'Date'[Order DateTime] >=_selectstart&&'Date'[Order DateTime]<=_selectend),[Rand])
If you want [Order DateTime] to show the date between two slicer selections, you can use the following measure:
Create measure.
Flag =
var _selectstart=SELECTEDVALUE('StartDate'[StartDate])
var _selectend=SELECTEDVALUE('EndDate'[EndDate])
return
IF(
MAX('Date'[Order DateTime])>=_selectstart&&MAX('Date'[Order DateTime])<=_selectend,1,0)
Place [Flag]in Filters, set is=1, apply filter.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Without know more a typical filter for date you can use DATESVETWEEN.
DATESBETWEEN(table1[coulmn1], startdate , enddate)
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 68 | |
| 59 | |
| 48 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 107 | |
| 106 | |
| 39 | |
| 27 | |
| 27 |