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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi,
I'm trying to create a new table for cretaing custom date range slicer as below
DATESBETWEEN function generates a table of dates without ensuring uniqueness, which can result in duplicate dates when combined with other date tables.
Try:
Date_filter =
VAR DefaultDates =
SELECTCOLUMNS(
CALENDAR(TODAY() - 30, TODAY()),
"Date", [Date],
"Type", "Default"
)
VAR CustomDates =
SELECTCOLUMNS(
CALENDAR(MIN('table'[date_column]), MAX('table'[date_column])),
"Date", [Date],
"Type", "Custom"
)
RETURN
DISTINCT(
UNION(
DefaultDates,
CustomDates
)
)
@Meera556 , Try this DAX measure
Date_filter =
UNION(
ADDCOLUMNS(
DATESBETWEEN(
DISTINCT(table[date_column]),
TODAY() - 30,
TODAY()
),
"Type", "Default"
),
ADDCOLUMNS(
CALENDAR(
MINX(DISTINCT(table[date_column]), [date_column]),
MAXX(DISTINCT(table[date_column]), [date_column])
),
"Type", "Custom"
)
)
Proud to be a Super User! |
|
Hi @bhanu_gautam ,
I have tried using DISTINCT function then I'm getting the below error
DatesBetween and DatesInPeriod functions are only accepting date column reference as a first argument.
You can create both steps separetly
Proud to be a Super User! |
|
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.