Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello All, I have this calc column, but the start dates are not correct, because when the year is starting, the Week Text must says:
-for dec-27 to dec-31: "W #53 Dec-27 / Dec-31"
-for jan1 and jan2: "W #1 Jan-01 / Jan-02"
Same for next years... any ideas?
Solved! Go to Solution.
@eduardosilvin3
Create a calculated column as follows:
Week Text =
VAR __T = FILTER( 'Calendar' , Calendar[Week Year] = EARLIER( 'Calendar'[Week Year] ) )
VAR __MinDate = MINX(__T , Calendar[Date] )
VAR __MaxDate = MAXX(__T , Calendar[Date] )
RETURN
"W #" & Calendar[Week Num] & " " & FORMAT( __MinDate , "Mmm-yy" ) & "/ " & FORMAT( __MaxDate , "Mmm-yy" )
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
try this @eduardosilvin3
Week Text =
VAR CurrentWeekYear = Calendar[Week Year]
VAR WeekStart = CALCULATE(MIN(Calendar[Date]), ALLEXCEPT(Calendar, Calendar[Week Year], Calendar[Week Num]))
VAR WeekEnd = CALCULATE(MAX(Calendar[Date]), ALLEXCEPT(Calendar, Calendar[Week Year], Calendar[Week Num]))
RETURN
"W #" & Calendar[Week Num] & " " & FORMAT(WeekStart, "MMM-yy") & " / " & FORMAT(WeekEnd, "MMM-yy")
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
@eduardosilvin3
Create a calculated column as follows:
Week Text =
VAR __T = FILTER( 'Calendar' , Calendar[Week Year] = EARLIER( 'Calendar'[Week Year] ) )
VAR __MinDate = MINX(__T , Calendar[Date] )
VAR __MaxDate = MAXX(__T , Calendar[Date] )
RETURN
"W #" & Calendar[Week Num] & " " & FORMAT( __MinDate , "Mmm-yy" ) & "/ " & FORMAT( __MaxDate , "Mmm-yy" )
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Working great, thanks!
sure sorry:
try this @eduardosilvin3
Week Text =
VAR CurrentWeekYear = Calendar[Week Year]
VAR WeekStart = CALCULATE(MIN(Calendar[Date]), ALLEXCEPT(Calendar, Calendar[Week Year], Calendar[Week Num]))
VAR WeekEnd = CALCULATE(MAX(Calendar[Date]), ALLEXCEPT(Calendar, Calendar[Week Year], Calendar[Week Num]))
RETURN
"W #" & Calendar[Week Num] & " " & FORMAT(WeekStart, "MMM-yy") & " / " & FORMAT(WeekEnd, "MMM-yy")
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Working great, thanks!
User | Count |
---|---|
93 | |
85 | |
77 | |
68 | |
62 |
User | Count |
---|---|
113 | |
99 | |
96 | |
64 | |
58 |