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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
lha
Helper I
Helper I

Calculating the number of days in week that have passed

Hello All,

 

I am trying to find a formula that will tell me how many days in the week have passed.

 

For example:

 

Week is Sunday to Saturday

 

Today is Tuesday

 

I need a formula that will returnt the number 2 (for two days have passed).

 

Thank you!

2 ACCEPTED SOLUTIONS
lha
Helper I
Helper I

Nevermind, I figured this out.

 

Thanks!

View solution in original post

This is probably the most complicated way of doing this but here it is how I determined how many days have passed:

 

Var

CurrentDate = Today()

Return

 

WEEKDAY(CurrentDate)-1

 

This gave me a numerical value in which I used to calculate the average daily production quantity by taking week to date production quanity and dividing it by the days that have passed.

 

I've had issues with refreshes on our company's internal report server when I only use the 2nd half of that formula so I've started to establish the current date using the Var code and haven't had issues since. 

 

View solution in original post

3 REPLIES 3
lha
Helper I
Helper I

Nevermind, I figured this out.

 

Thanks!

Greg_Deckler
Community Champion
Community Champion

Please post solution if you are able, someone else might have this question. I can think of a few ways of doing this.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

This is probably the most complicated way of doing this but here it is how I determined how many days have passed:

 

Var

CurrentDate = Today()

Return

 

WEEKDAY(CurrentDate)-1

 

This gave me a numerical value in which I used to calculate the average daily production quantity by taking week to date production quanity and dividing it by the days that have passed.

 

I've had issues with refreshes on our company's internal report server when I only use the 2nd half of that formula so I've started to establish the current date using the Var code and haven't had issues since. 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors