Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
EdipGashi
Frequent Visitor

The most complicated request I've ever had about Weeks - Date

Dear all,

Can anyone help me, I would be very grateful to you.

 

Based on the date, I need to calculate the 3 columns with Month, Week, and Period. But as you can see in the photo below, the last week of the month should also have the remaining days that pass into the next month. And based on this condition, if the week has a few more days to finish, even if they belong to the next month, it must remain in the current month. And finally, the period of how many days there are in that week.

For example, the 5th week of November is from 27.11.2022 to 03.12.2022, which means that 3 days of December must be in November.
The month of December will start on 04.12.2022 and it will be the first week of this month.
This calculation logic must continue for all the dates we have in the table.

If you know how to do just 1 column from my request, I would be very grateful.

see photo:


EdipGashi_1-1675410670906.png

 

 

1 REPLY 1
lbendlin
Super User
Super User

Do not attempt to do this in Power BI.  Use an external calendar table that has these values precomputed.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors