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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

calculating days until next quarter from today

Hi all,

 

I am trying to calculate days until next quarter from current date, I have used the 'Quarter' and 'today' function to get the current quarter. How do I count the number of days from current date to the beginning of next quarter.

 

example: today is 3/26/2020; so, I want to get the value 5. since, there are 5 days until quarter 2 of the year 2020. Thank you.

 

Kind Regards,

Shlok Shah

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I do not have any date columns that I could depend on for using DAX in built quarter functions...

Here's how I did it(the harder way)

 

Current quarter = ROUNDUP(MONTH(TODAY()) / 3,0 )
First month in quarter = ([Current quarter]*3)-2
First day of the quarter = DATE(YEAR(TODAY()),[First month in quarter],1)
Days since first day of Quarter = DATEDIFF([First day of the quarter],TODAY(),DAY)
Last month of current quarter = ([Current quarter]*3)
Last day of current quarter = EOMONTH([First day of current quarter],2)
Total days in current quarter = DATEDIFF([First day of current quarter],[Last day of current quarter],DAY)
Days until next quarter = CALCULATE([Total days in current quarter]-[Days since first day of Quarter])days until next quarter.PNG

View solution in original post

1 REPLY 1
Anonymous
Not applicable

I do not have any date columns that I could depend on for using DAX in built quarter functions...

Here's how I did it(the harder way)

 

Current quarter = ROUNDUP(MONTH(TODAY()) / 3,0 )
First month in quarter = ([Current quarter]*3)-2
First day of the quarter = DATE(YEAR(TODAY()),[First month in quarter],1)
Days since first day of Quarter = DATEDIFF([First day of the quarter],TODAY(),DAY)
Last month of current quarter = ([Current quarter]*3)
Last day of current quarter = EOMONTH([First day of current quarter],2)
Total days in current quarter = DATEDIFF([First day of current quarter],[Last day of current quarter],DAY)
Days until next quarter = CALCULATE([Total days in current quarter]-[Days since first day of Quarter])days until next quarter.PNG

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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