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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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