Forum Discussion
Date Segmenter
- 1 year ago
Hi valmenara - you can create a dynamic date picker that meets your requirements using a combination of Power Query, Date Tables, and Slicers.
Create a date table using calculated table with DAX expression and mark the table as Date.The date slicer will always adjust to the range of dates available in your dataset after a refresh.Users can manually select their desired date range within the slicer.The report will remain dynamic and reflect the latest data.
if you want to display the selected range dynamically with text, use below measure:
SelectedDateRange =
"From " & MIN('DateTable'[Date]) & " to " & MAX('DateTable'[Date]) - 1 year ago
Create a dates table that references the min and max dates in your fact table.
CalendarTable = VAR MinDate = MIN('FactTable'[Date]) -- Replace 'FactTable' with your actual fact table name VAR MaxDate = MAX('FactTable'[Date]) RETURN ADDCOLUMNS( CALENDAR(MinDate, MaxDate), "Year", YEAR([Date]), "Month Number", MONTH([Date]), "Month Name", FORMAT([Date], "MMMM"), "Month & Year", FORMAT([Date], "MMM YYYY"), "Year & month", FORMAT([Date], "YYYYMM"), --custom sort for Month & Year "Quarter", "Q" & FORMAT(ROUNDUP(MONTH([Date]) / 3, 0), "0"), "Year-Quarter", FORMAT(YEAR([Date]), "0000") & "-Q" & FORMAT(ROUNDUP(MONTH([Date]) / 3, 0), "0"), "Week Number", WEEKNUM([Date]), "Day Name", FORMAT([Date], "dddd"), "Day of Week", WEEKDAY([Date], 2) -- 1=Sunday, 2=Monday )If this isn't what you're looking for, please define Date Segmenter, include expected out and the reasoning behind.
Hi valmenara - you can create a dynamic date picker that meets your requirements using a combination of Power Query, Date Tables, and Slicers.
Create a date table using calculated table with DAX expression and mark the table as Date.The date slicer will always adjust to the range of dates available in your dataset after a refresh.Users can manually select their desired date range within the slicer.The report will remain dynamic and reflect the latest data.
if you want to display the selected range dynamically with text, use below measure:
SelectedDateRange =
"From " & MIN('DateTable'[Date]) & " to " & MAX('DateTable'[Date])