Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi Team,
I have weeknumber column WeekDay Colum and Year column, I have to find date for this.
Can you please help me.
Thanks!
Solved! Go to Solution.
Hi @Anonymous ,
According to your description, here's my solution, create a column.
Column =
VAR _firstweek =
7 - WEEKDAY ( DATE ( [Year], 1, 1 ) ) + 1
VAR _between = ( [Week] - 1 ) * 7
VAR _lastweek =
SWITCH (
[WeekDay],
"Monday", 1,
"Tuesday", 2,
"Wedsday", 3,
"Thursday", 4,
"Friday", 5,
"Saturday", 6,
"Sunday", 7
)
RETURN
DATE ( [Year], 1, 1 ) + _firstweek + _between + _lastweek
Get the correct result:
I attach my sample below for your reference.
Best regards,
Community Support Team_yanjiang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
According to your description, here's my solution, create a column.
Column =
VAR _firstweek =
7 - WEEKDAY ( DATE ( [Year], 1, 1 ) ) + 1
VAR _between = ( [Week] - 1 ) * 7
VAR _lastweek =
SWITCH (
[WeekDay],
"Monday", 1,
"Tuesday", 2,
"Wedsday", 3,
"Thursday", 4,
"Friday", 5,
"Saturday", 6,
"Sunday", 7
)
RETURN
DATE ( [Year], 1, 1 ) + _firstweek + _between + _lastweek
Get the correct result:
I attach my sample below for your reference.
Best regards,
Community Support Team_yanjiang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
So instead of variables, you can use the columns in it. Please let me know if you find any issues.
@Anonymous
Can you provide the sample data and output?
@Anonymous
I have created a measure as follows. Maybe this can help you to reach what you need.
SelectedDate =
VAR DateTable =
CALENDARAUTO ()
VAR WeekNumber = 41
VAR WeekDayValue = "Tuesday"
VAR YearValue = 2023
RETURN
MINX (
FILTER (
DateTable,
FORMAT ( [Date], "dddd" ) = WeekDayValue
&& WEEKNUM ( [Date] ) = WeekNumber
&& YEAR ( [Date] ) = YearValue
),
[Date]
)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 38 | |
| 34 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 65 | |
| 44 | |
| 30 | |
| 28 |