Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
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
I'm working with a dataset that only has Posting Month and Posting Year (no specific dates). I created a date column by setting all dates to the 1st of each month (e.g., 01/01/2024, 01/02/2024) to use with a between date slicer.
Problem: When users select a date range like 15/01/2024 to 15/02/2024, only February shows because 01/01/2024 falls outside this range.
I've tried:
What I need: Users should see ALL months that fall within the selected date range, regardless of which specific day they choose within those months.
Is there a way to make a between date slicer work properly with month-level data, or should I abandon the between slicer approach entirely?
Any suggestions appreciated!
Solved! Go to Solution.
Use a full calendar table with out skips and a column that returns the start or end of month.
Create a many-to-many relationship between the start date columns with calendar filtering the fact table but use the date column in the slicer
Or establish a virtual relationship between the two tables using a measure
Please see the attached pbix.
Hi @RajeevMychael1,
Thank you for sharing your final solution and the DAX used for the Calendar table. This will be helpful for others facing the same month-level slicer issue. Your method of creating a complete calendar with MonthStart and MonthEnd, and syncing the two sheets, matches the suggestions above and is a reliable data-modeling pattern in Power BI.
Glad to hear everything is working as expected now, and thanks again for updating the thread with the final solution!
Thanks for all your responses and help. Did manage to fix this by creating a table with the below formula
Use a full calendar table with out skips and a column that returns the start or end of month.
Create a many-to-many relationship between the start date columns with calendar filtering the fact table but use the date column in the slicer
Or establish a virtual relationship between the two tables using a measure
Please see the attached pbix.
Hi @RajeevMychael1,
You can create a dedicated date table that defines the actual start and end dates for each month:
DateTable =
ADDCOLUMNS(
CALENDAR(DATE(2020,1,1), DATE(2025,12,31)),
"Month Start", EOMONTH([Date], -1) + 1,
"Month End", EOMONTH([Date], 0),
"Month Year", FORMAT([Date], "MMM YYYY")
)Then create relationships and use this logic in your measures:
Sales Amount Filtered =
CALCULATE(
[Sales Amount],
FILTER(
'DateTable',
'DateTable'[Month Start] <= MAX('SlicerDateTable'[Date]) &&
'DateTable'[Month End] >= MIN('SlicerDateTable'[Date])
)
)The between date slicer in Power BI works at the day level, If you only have Posting Month and Posting Year, and you create artificial dates like 01/01/2024, the slicer will filter by that exact day and that’s why selecting 15/01/2024–15/02/2024 excludes January, the slicer sees 01/01/2024 as outside the range.
The correct approach is to model your data at the month level instead of forcing day values:
This way, when users select January–February, both months are included regardless of which day they choose.
Did it work? 👍 A kudos would be appreciated
🟨 Mark it as a solution to help spread knowledge 💡
Hi I tried this method earlier and i think this is the way to go. I tried this method the reason i backed from this is when i m moving the slider its showing some numbers which is not present in the column. Attaching the picture for the reference.
Hi,
Share some data to work with and show the expected result. Share data in a format that can be pasted in an MS Excel file.
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 |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |