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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Percent of Month Based on Custom Week Ranges

Hello,

 

I have a data table that uses pre-determined weeks to create invoice totals. For example, Week 1 of January is Jan 1.-Jan 6. Week 2 is Jan6.-Jan13th etc. I need to create a measure (using a live dataset) that says something like since week 1 is only 5 days, 5/31 = 16% of that month. It should look something like (note I don't currently have a field like "Dayrange"):

 

Invoice WeeksPercent of MonthDayrangeInvoiceID
116%5$123123.1231
223%7$123.1232
323%7$123123123123.1233

 

 

3 REPLIES 3
amitchandak
Super User
Super User

Is there way to know start and end date of week. then

datediff([start_of_week],[end_of_week],day)/day(eomonth([end_of_week]))

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

@amitchandak 

I was trying to avoid that solution as I have no way of finding the start and end date for each week. Although week 1 runs from Jan 1. -Jan 5. that doesn't mean that we received invoices every day in that range. In my case I only have invoices on the 3rd of January making that a bad method to find the start/end date. 

 

hi  @Anonymous 

For your case, you must define the dim date in advance, for example:

Week Start Date End Date

Then use this to calculate the Dayrange.

 

Regards,

Lin

 

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.