Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi All,
I have a sales date and I need to create start and end date slicers.
I tried with between and its not giving the option to get start date and end date.
I need to show two date slicers, one for the start date and one for the end date, using the sales date.
Please help how to do this.
Solved! Go to Solution.
Hi @viswaaa,
You can create two disconnected tables StartDateTable and EndDateTable
StartDateTable = CALENDAR(MIN('Sales'[SalesDate]), MAX('Sales'[SalesDate]))
EndDateTable = CALENDAR(MIN('Sales'[SalesDate]), MAX('Sales'[SalesDate]))
Add both slicers in your report respectively.
Now create a measure:-
Selected Sales =
VAR StartDate = MIN(StartDateTable[Date])
VAR EndDate = MAX(EndDateTable[Date])
RETURN
CALCULATE(
SUM('Sales'[SalesAmount]),
FILTER('Sales',
'Sales'[SalesDate] >= StartDate &&
'Sales'[SalesDate] <= EndDate
)
)
and use this measure in the visuals
🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!
Hi @viswaaa,
You can create two disconnected tables StartDateTable and EndDateTable
StartDateTable = CALENDAR(MIN('Sales'[SalesDate]), MAX('Sales'[SalesDate]))
EndDateTable = CALENDAR(MIN('Sales'[SalesDate]), MAX('Sales'[SalesDate]))
Add both slicers in your report respectively.
Now create a measure:-
Selected Sales =
VAR StartDate = MIN(StartDateTable[Date])
VAR EndDate = MAX(EndDateTable[Date])
RETURN
CALCULATE(
SUM('Sales'[SalesAmount]),
FILTER('Sales',
'Sales'[SalesDate] >= StartDate &&
'Sales'[SalesDate] <= EndDate
)
)
and use this measure in the visuals
🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!
Hi @grazitti_sapna ,
This is working fine.
But I have a text table where I have 30 columns and these should filter based on the start and end date slicers.
How to do this.
Hi @viswaaa ,
Power BI does not natively tie two date slicers to the same field with independent constraints, but you can achieve this with a combination of slicers and measures.
Two independent date slicers with a helper table
Create a calendar table if you don’t have one:
Mark as Date table.
Create relationships:
Sales[SalesDate] → Calendar[Date] (many-to-one)
Create two slicers using Calendar[Date] for Start and End, but you’ll enforce the logic with measures.
Create measures to filter visuals based on Start and End selections:
StartDateChosen = MIN(Calendar[Date])
EndDateChosen = MAX(Calendar[Date])
Use a Visual-Level Filter or Page Filter to apply:
For visuals you want to be controlled by the start date: [SalesDate] >= [StartDateChosen]
For visuals you want to be controlled by the end date: [SalesDate] <= [EndDateChosen]
Example measure for a specific visual:
Sales Amount (with Start constraint) = CALCULATE([Sales Amount], FILTER(ALL(Calendar), Calendar[Date] >= MIN(Calendar[Date]) && Calendar[Date] <= MAX(Calendar[Date]) ), Sales[SalesDate] >= MIN(Calendar[Date]), Sales[SalesDate] <= MAX(Calendar[Date]) )
Practical tip:
Use DAX to create a single combined filter:
StartDate = MIN(Calendar[Date]) (driven by the Start slicer)
EndDate = MAX(Calendar[Date]) (driven by the End slicer)
Then apply:
CALCULATE([Sales Amount], Sales[SalesDate] >= StartDate, Sales[SalesDate] <= EndDate)
Please mark this post as solution if it helps you. Appreciate Kudos.
Hi @viswaaa, based on your description I understood that you mean that you have two date columns in your data) one for the StartDate, the other for the EndDate) that you want to use separately in your slicer like this:
If you're trying to filter for two different columns the easiest option is to use two separate slicers for each column:
- Set the "StartDate" Slicer to "After" rather than "Between"
- Set the "EndDate" Slicer to "Before" rather than "Between"
Between only works if you're using the same column for filtering.
Use a separate Date table and add two slicers from it—one labeled Start Date, one End Date. Then filter your Sales data using a measure like
Filtered Sales =
CALCULATE(
SUM(Sales[Amount]),
FILTER(
Sales,
Sales[SalesDate] >= MIN(DateTable[Date]) &&
Sales[SalesDate] <= MAX(DateTable[Date])
)
)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 50 | |
| 44 | |
| 42 | |
| 19 | |
| 19 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 33 | |
| 32 | |
| 32 |