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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DarrenLau
Advocate I
Advocate I

Measure to calculate future quarter backlog

Hi,

 

Looking for some help in creating a measure to showfuture quarter backlog on the same page that is filtered to current quarter.

 

Scenario: Report page is filtered (sliced?) to show 2019 Q4 data. I want to also show 2020 Q1 backlog on the same page.

 

Additional info: My dataset has a date table set up with weeks, quarters, etc in numeric (1,2,3 ...etc)  as well as labels (eg Q1, Week 1).

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

Hi @DarrenLau ,

 

Sorry for late reply, we can create a measure using following formula to meet your requirement.

 

 

NextQuarterValue =
VAR m =
    MONTH ( MAX ( 'Table'[Date] ) )
VAR CurrentQuarter =
    SWITCH (
        TRUE (),
        m IN { 1, 2, 3 }, 1,
        m IN { 4, 5, 6 }, 2,
        m IN { 7, 8, 9 }, 3,
        4
    )
VAR maxday =
    DATE ( YEAR ( MAX ( 'Table'[Date] ) ), CurrentQuarter * 3, SWITCH ( CurrentQuarter, 1, 31, 2, 30, 3, 30, 4, 31 ) )
VAR firstday = maxday + 1
RETURN
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            [Date] >= firstday
                && [Date]
                    <= DATE ( YEAR ( firstday ), MONTH ( firstday ) + 3, 1 ) - 1
        )
    )

 

 

5.PNG6.PNG


If it doesn't meet your requirement, kindly share your sample data and expected result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.


Best regards,

Community Support Team _ Dong Li
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

3 REPLIES 3
v-lid-msft
Community Support
Community Support

Hi @DarrenLau ,

 

Sorry for late reply, we can create a measure using following formula to meet your requirement.

 

 

NextQuarterValue =
VAR m =
    MONTH ( MAX ( 'Table'[Date] ) )
VAR CurrentQuarter =
    SWITCH (
        TRUE (),
        m IN { 1, 2, 3 }, 1,
        m IN { 4, 5, 6 }, 2,
        m IN { 7, 8, 9 }, 3,
        4
    )
VAR maxday =
    DATE ( YEAR ( MAX ( 'Table'[Date] ) ), CurrentQuarter * 3, SWITCH ( CurrentQuarter, 1, 31, 2, 30, 3, 30, 4, 31 ) )
VAR firstday = maxday + 1
RETURN
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            [Date] >= firstday
                && [Date]
                    <= DATE ( YEAR ( firstday ), MONTH ( firstday ) + 3, 1 ) - 1
        )
    )

 

 

5.PNG6.PNG


If it doesn't meet your requirement, kindly share your sample data and expected result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.


Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you for the detailed measure. I will apply it using the fields in my model and test it out.

The measure works with a slight modification - the backlog table has an active relationship based on Order Entry Date, and a secondary relationship on Estimated Ship Date.

 

I substituted 

SUM ( 'Table'[Value] )

 

with the backlog measure using the Estimated Ship Date relationship

 

Backlog = calculate(sum('Backlog'[BacklogUSD]), USERELATIONSHIP( Backlog[EstShipDate], 'Calendar'[Date]))

 

Thanks for the help, much appreciated.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.