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
win_anthony
Resolver III
Resolver III

How to Calculate Partial Quarter / Months?

The goal is to calculate partial Quarter / Months. My client has their fiscal calendar that follows the school calendar (start = September 1 / end = August 31). I created a bar chart which highlights the fiscal quarter's results but the client noted that there was something off about FQ4 2021. All of the previous fiscal quarters had complete data but since we are currently in FQ4 2021, the results of the bar chart makes it seem as if the sales have fallen but the fact is that the quarter is not complete. 

 

How do you dynamically calculate Partial (fiscal) Quarter / Months? Below you will find the current measure and screenshot of the current bar chart. Any advice on how to calculate partial Quarter / Months will be greatly appreciated. 

 

Current Measure = Total Sales / 90 (90 days represented for each quarter) >> Client noted that since we are in the final Fiscal Quarter, the denominator should divide by the number of days that has been completed (Start of FQ4 = June 1 >> so calculation should be June 1 - Today-1 ). Is there a way to make this dynamic? 

 

CALCULATE(
    DIVIDE(
        [Total Sales],
        90 --This number represents the number of days in each quarter
    )
)

 

Screenshot of Current Bar Chart >> Notice FQ4 2021, client would like the current fiscal quarter to be calculated with the current number of days that has been completed (Start of FQ4 = June 1 >> so calculation should be June 1 - Today-1 ).

win_anthony_1-1625842630104.png

 

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @win_anthony ,

 

Try the following formula:

 

Measure = 
IF(
    DATEDIFF( MIN('DATE'[Date]), TODAY(), MONTH ) < 3,
    DIVIDE( SUM(Sales[Value]), DATEDIFF( MIN('DATE'[Date]), TODAY(), DAY ) ),
    DIVIDE( SUM(Sales[Value]), 90 )
)

 image.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

View solution in original post

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @win_anthony ,

 

Try the following formula:

 

Measure = 
IF(
    DATEDIFF( MIN('DATE'[Date]), TODAY(), MONTH ) < 3,
    DIVIDE( SUM(Sales[Value]), DATEDIFF( MIN('DATE'[Date]), TODAY(), DAY ) ),
    DIVIDE( SUM(Sales[Value]), 90 )
)

 image.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

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

amitchandak
Super User
Super User

@win_anthony , Create two new columns in date table and try measure like

 

Columns

Qtr Start Date = DATEADD(STARTOFYEAR('Date'[Date],"8/31"),QUOTIENT(DATEDIFF('Date'[Start Of Year], 'Date'[Date],MONTH),3)*3,MONTH)
day of Qtr = datediff([Start Qtr],[date],day)

 

 

Measure , alternate in comments
QTD QTY forced=
var _max = maxx(allselected('Date'), [Date of Qtr])
return
calculate(Sum('order'[Qty]),DATESQTD('Date'[Date]),filter('Date','Date'[Date of Qtr]<=_max))
or
calculate(calculate(Sum('order'[Qty]),DATESQTD('Date'[Date])),filter('Date','Date'[Date of Qtr]<=_max))

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

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.