cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## HOW TO CREATE DATE(Thursday OF WEEK) FORM YEAR-MONTH

I have column year-week  ,i need to create date form year week(Thursday of week)

in Qlikview i used function "makedate" but  i don't know in PBI used any function?

1 ACCEPTED SOLUTION
Community Support

Try this code to create a calculated table.

``````Calendar Only Thursday =
VAR _Calendar_Only_Thursday =
FILTER (
CALENDAR ( DATE ( 2023, 01, 01 ), DATE ( 2023, 12, 31 ) ),
"Year", YEAR ( [Date] )
),
WEEKDAY ( [Date], 2 ) = 4
)
_Calendar_Only_Thursday,
"Rank",
RANKX (
FILTER ( _Calendar_Only_Thursday, [Year] = EARLIER ( [Year] ) ),
[Date],
,
ASC,
DENSE
)
)
RETURN
SELECTCOLUMNS (
"Year Week",
[Year] * 100 + [Rank],
"Date Need", [Date]
)``````

Result is as below.

Best Regards,
Rico Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 REPLIES 2
Community Support

Try this code to create a calculated table.

``````Calendar Only Thursday =
VAR _Calendar_Only_Thursday =
FILTER (
CALENDAR ( DATE ( 2023, 01, 01 ), DATE ( 2023, 12, 31 ) ),
"Year", YEAR ( [Date] )
),
WEEKDAY ( [Date], 2 ) = 4
)
_Calendar_Only_Thursday,
"Rank",
RANKX (
FILTER ( _Calendar_Only_Thursday, [Year] = EARLIER ( [Year] ) ),
[Date],
,
ASC,
DENSE
)
)
RETURN
SELECTCOLUMNS (
"Year Week",
[Year] * 100 + [Rank],
"Date Need", [Date]
)``````

Result is as below.

Best Regards,
Rico Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Frequent Visitor

This code would do the job for you.

YEARWEEK = YEAR('Date'[Date])& WEEKNUM('Date'[Date],1)

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors