Skip to main content
cancel
Showing results for 
Search instead 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

Reply
Rigolleto
Resolver I
Resolver I

Date of the week base on the day name

Hi,

 

I need help in ordet to get the Date of a week base on the Week number and name of the day, check the attached screenshot, for this example I have week=40 and the name of the day, checking the calendar, the date should as this list

NOVEMBER /WEEK 40

MONDAY =10/31/2020

TUESDAY=11/01/2020

WEDNESDAY=11/02/2020

THURSDAY=11/03/2020

FRIDAY =11/03/2020

SATURDAY=11/04/2020

SUNDAY =11/05/2020

Can somebody help they way to create the dates base on Week and Day Name

 

DAYOFTHEWEEK.png

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Rigolleto , With week and year you can get date and from day you can get week day

 

Week to Date = var _st = date([year],1,1) //or //date(2020,1,1)
var _week = [Week]
Return _st+((_week-1)*7) -WEEKDAY(_st,2)+1

 

Week day = Format([Date], "ddd")

Week day = Format([Date], "dddd")

 

refer last question : https://amitchandak.medium.com/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3

View solution in original post

2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @Rigolleto ,


Depends on what you want, you need first to define a date table ,then you can use vlookup function to create a table as you need.

Here is a related case that should be able to help you:Solved: Obtain Dates from Weeknumber - Microsoft Power BI Community

 

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

amitchandak
Super User
Super User

@Rigolleto , With week and year you can get date and from day you can get week day

 

Week to Date = var _st = date([year],1,1) //or //date(2020,1,1)
var _week = [Week]
Return _st+((_week-1)*7) -WEEKDAY(_st,2)+1

 

Week day = Format([Date], "ddd")

Week day = Format([Date], "dddd")

 

refer last question : https://amitchandak.medium.com/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.