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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
SQuazi
Frequent Visitor

Cumulative sum for QTD (Custom Quarter)

SQuazi_0-1690194133183.png

We have fortnightly data and ask is to show cumulative sum of ProductCount on MTD, YTD and QTD level.

In this requirement, FY starts from Sep and Q1=Sep-Nov and so on

MTD and YTD is working as expected, but since for QTD we do not have any option to define quarter start.

TestQTD is the expected output in screenshot

Kindly suggest possible solution.

Appreciate your inputs.

 

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @SQuazi 

 

You can try the following methods. The fiscal year calendar is shown.

vzhangti_0-1690443762528.png

Measure:

TestQTD = 
CALCULATE ( SUM ( 'Table'[ProductCount] ),
    FILTER ( ALL ( 'Date' ),
        [Date] <= SELECTEDVALUE ( 'Table'[ReportingDate] )
            && [FYQ] = SELECTEDVALUE ( 'Date'[FYQ] )
    )
)

vzhangti_1-1690443804178.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

4 REPLIES 4
v-zhangti
Community Support
Community Support

Hi, @SQuazi 

 

You can try the following methods. The fiscal year calendar is shown.

vzhangti_0-1690443762528.png

Measure:

TestQTD = 
CALCULATE ( SUM ( 'Table'[ProductCount] ),
    FILTER ( ALL ( 'Date' ),
        [Date] <= SELECTEDVALUE ( 'Table'[ReportingDate] )
            && [FYQ] = SELECTEDVALUE ( 'Date'[FYQ] )
    )
)

vzhangti_1-1690443804178.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

SQuazi
Frequent Visitor

@Manoj_Nair STARTOFQUARTER does not take 2 arguments 

Manoj_Nair
Solution Supplier
Solution Supplier

@SQuazi- Check this out, let me know if this work for you.

ProductValue QTD =
CALCULATE(
    SUM('Table'[ProductValue]),
    FILTER(
        ALL('Table'),
        'Table'[Date] <= MAX('Table'[Date])
            && YEAR('Table'[Date]) = YEAR(MAX('Table'[Date]))
            && STARTOFQUARTER('Table'[Date], 3) = STARTOFQUARTER(MAX('Table'[Date]), 3)
    )
)

Hi try it :

 

QTD = 
Var QuarterNumber = INT( (MOD('Table'[Date].[NbMonth] + 3, 12)) / 3)
RETURN
SUMX(FILTER('Table', INT( (MOD('Table'[Date].[NbMonth] + 3, 12)) / 3) == QuarterNumber && 'Table'[Date] < EARLIER('Table'[Date]) + 1 && 'Table'[Date].[Year] == EARLIER('Table'[Date].[Year])), 'Table'[ProductCount])

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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

Users online (27,788)