Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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
Solved! Go to Solution.
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])
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])
User | Count |
---|---|
50 | |
24 | |
18 | |
17 | |
14 |
User | Count |
---|---|
91 | |
84 | |
39 | |
25 | |
21 |