Forum Discussion
Anonymous
4 years agoNot applicable
Week Number parameters
Hi, I'm working on a weekly production plan, I created a date table with the week numbers (Formula: Weeknum) My working week starts on Sunday and ends on Saturday. There are weeks that are s...
- Anonymous4 years ago
Thank you tamerj1 for your reponse.
just one detail ,how I can convert "Slicer Month" to a Date Format, now it is a Text ?
- 4 years ago
Hi Anonymous
Create another column (Slicer Month Number) and then use the option sort by column to sort the Slicer Month by the Slicer Month NumberSlicer Month = VAR CurrentMonth = 'Date'[Month Number] VAR CurrentYearWeekTable = FILTER ( CALCULATETABLE ( 'Date', ALLEXCEPT ( 'Date', 'Date'[Year], 'Date'[Week Number] ) ), 'Date'[Month Number] = CurrentMonth ) VAR MaxWeekday = MAXX ( CurrentYearWeekTable, WEEKDAY ( 'Date'[Date], 1 ) ) VAR MonthNumber = IF ( MaxWeekday < 3, CurrentMonth + 1, CurrentMonth ) RETURN MonthNumber
tamerj1
4 years agoCommunity Champion
Hi Anonymous
Here is a sample file with the solution https://www.dropbox.com/t/SfZdZRuR9IMEblZN
You need to create a new month column in the date table to use as slicer, as follows:
Slicer Month =
VAR CurrentMonth = 'Date'[Month Number]
VAR CurrentYearWeekTable =
FILTER (
CALCULATETABLE ( 'Date', ALLEXCEPT ( 'Date', 'Date'[Year], 'Date'[Week Number] ) ),
'Date'[Month Number] = CurrentMonth
)
VAR MaxWeekday =
MAXX ( CurrentYearWeekTable, WEEKDAY ( 'Date'[Date], 1 ) )
VAR MonthNumber =
IF (
MaxWeekday < 3,
CurrentMonth + 1,
CurrentMonth
)
RETURN
FORMAT ( DATE ( 1, MonthNumber, 1 ), "MMMM" )Anonymous
4 years agoNot applicable
Thank you tamerj1 for your reponse.
just one detail ,how I can convert "Slicer Month" to a Date Format, now it is a Text ?