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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Gregoire
Frequent Visitor

Get Delta Per Month and per Year in a Matrix with date hierarchy

I want to get the delta with the previews month when the raw hierarchy is a month and get it by year when the hierarchy is year.
I know I can have it by creating a another column but I want to display it in the same column for not confuse the reader.
So, my question is can I do that? And how?

here is what I have now.

Gregoire_0-1684139834184.png

 

But as you can see the delta I have for 2020 is 10'640 but what I expect is 250'798.

 

My actual delta formula is 

 

Delta =
IF(
    ISFILTERED('TD_Date'[Date]),
    ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."),
    VAR __PREV_MONTH =
        CALCULATE(
            SUM('TF_Case'[Case]),
            DATEADD('TD_Date'[Date].[Date], -1, MONTH)
        )
    RETURN
        DIVIDE(
            SUM('TF_Case'[Case])
                - __PREV_MONTH,
            1
        )
)


Thanks for your time 🙂

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

use ISINSCOPE rather than ISFILTERED.

View solution in original post

For thus how are looking a what the formula look in the end here is it

 

Delta =
IF(
    ISINSCOPE('TD_Date'[Date].[Month]),
    VAR __PREV_MONTH =
        CALCULATE(
            SUM('TF_Case'[Case]),
            DATEADD('TD_Date'[Date].[Date], -1, MONTH)
        )
    RETURN
        DIVIDE(
            SUM('TF_Case'[Case])
                - __PREV_MONTH,
            1
        ),
    IF(
        ISINSCOPE('TD_Date'[Date].[Year]),
        VAR __PREV_YEAR =
            CALCULATE(
                SUM('TF_Case'[Case]),
                DATEADD('TD_Date'[Date].[Date], -1, YEAR)
            )
        RETURN
            DIVIDE(
                SUM('TF_Case'[Case])
                    - __PREV_YEAR,
                1
            ),
            VALUE(0)
        )
)

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

use ISINSCOPE rather than ISFILTERED.

For thus how are looking a what the formula look in the end here is it

 

Delta =
IF(
    ISINSCOPE('TD_Date'[Date].[Month]),
    VAR __PREV_MONTH =
        CALCULATE(
            SUM('TF_Case'[Case]),
            DATEADD('TD_Date'[Date].[Date], -1, MONTH)
        )
    RETURN
        DIVIDE(
            SUM('TF_Case'[Case])
                - __PREV_MONTH,
            1
        ),
    IF(
        ISINSCOPE('TD_Date'[Date].[Year]),
        VAR __PREV_YEAR =
            CALCULATE(
                SUM('TF_Case'[Case]),
                DATEADD('TD_Date'[Date].[Date], -1, YEAR)
            )
        RETURN
            DIVIDE(
                SUM('TF_Case'[Case])
                    - __PREV_YEAR,
                1
            ),
            VALUE(0)
        )
)

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors