Forum Discussion
How to set Date Parameters to show data between 2 dates selected from 1 date column
- 8 months ago
1) Create two parameters
@StartDate (Date/Time)
@EndDate (Date/Time)
Set:
Data type = Date/Time
Allow null = No (or give defaults)
2) Filter the dataset on the single date column
Your dataset already has EntryDate — that’s enough.
In the dataset query filter (or WHERE clause equivalent):
WHERE EntryDate >= @StartDate AND EntryDate <= @EndDate3) If using the Dataset Filters (no SQL)
If your SharePoint List dataset doesn’t expose SQL:
Open Dataset Properties
Go to Filters
Add:
Expression: =Fields!EntryDate.Value
Operator: >=
Value: =Parameters!StartDate.Value
Add another filter:
Operator: <=
Value: =Parameters!EndDate.Value
Hi Alice,
You do not need to create separate Start Date and End Date columns in your dataset. Since you already have one date column (Entry Date), Power BI can handle this directly.
i can provide you two ways to do it....
1st method : ##Easiest and Recommended Way (No Parameters Needed)
Use a Date Slicer instead of parameters.
Steps:
- Add your report visual (table, chart, etc.)
- Add a Slicer visual
- Drag Entry Date into the slicer
- Change the slicer type to “Between”
- Select the From Date and To Date
All visuals will automatically show data between the selected dates.
This works perfectly with SharePoint List data and does not require Query Designer or any coding.
2nd method : ###Using Parameters (Advanced)
Only use this if parameters are mandatory.
- Create two parameters:
Start Date
End Date
- Create a DAX measure:
Show Data = IF (SELECTEDVALUE ( Table[Entry Date] ) >= [Start Date Parameter] && SELECTEDVALUE ( Table[Entry Date] ) <= [End Date Parameter], 1, 0)
Apply this measure as a visual-level filter (Show Data = 1)
This approach is more complex and usually not required.
Best tips i can give is : Use a Date Slicer., It is simple for users, requires no Power Query or SQL, and works well with SharePoint Lists.