Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello dear community,
I would like to create a new column on my Calendar Table who gives the time range instead of the week num. For example :
For Week number 1 of 2023, ill get a value like "02/01 to 08/01".
ChatGPT tried to give me this solution, who only works for the first year 2023 :
@LZNPM Try:
Range =
VAR __WeekNum = [WeekNum]
VAR __Year = YEAR([Date])
VAR __Min = MINX(FILTER('Dates', [WeekNum] = __WeekNum && YEAR([Date]) = __Year), [Date])
VAR __Max = MAXX(FILTER('Dates', [WeekNum] = __WeekNum && YEAR([Date]) = __Year), [Date])
VAR __Return = FORMAT(__Min, "dd/MM") & " to " & FORMAT(__Max, "dd/MM")
RETURN
__Return
Thank you very much Greg ! Your code works very well... until the year switch ! For all weeks in 2023 the correct time range is written, but for the first week of 2024, the value of the new column is "01/01 to 31/12". How can I correct it ? If you have an idea.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |