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 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 situated in 2 months
Example 01: Week 32 , start in Sunday 31/07/2022 ,ends 06/08/2022 , 1 day in July and 6 days in August . In this case Dax considered this week in July --it's not correct for me
I want to apply this parameter when retrieving the week number in case the week is situated in 2 different months.
- (Case Example 01) The Week 32 will be conidered in July if the number of days of this week are =>3 are in July , else considere in August.
How I can do this ?
Solved! Go to Solution.
Thank you @tamerj1 for your reponse.
just one detail ,how I can convert "Slicer Month" to a Date Format, now it is a Text ?
Hi @AMar22
Create another column (Slicer Month Number) and then use the option sort by column to sort the Slicer Month by the Slicer Month Number
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
MonthNumber
Hi @tamerj1 ,I mean to put slicer in descending order in the visual (report) like: January, February, March.....SO I must put the format as a dat
Hi @AMar22
Create another column (Slicer Month Number) and then use the option sort by column to sort the Slicer Month by the Slicer Month Number
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
MonthNumber
Hi @AMar22
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" )
Thank you @tamerj1 for your reponse.
just one detail ,how I can convert "Slicer Month" to a Date Format, now it is a Text ?
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.
User | Count |
---|---|
10 | |
7 | |
5 | |
4 | |
3 |
User | Count |
---|---|
13 | |
11 | |
9 | |
8 | |
8 |