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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Analyze Performance Drop From Selected Period Compare to Previous

Dear Community,

I have a trend that shows every project KPI performance like below.

 

My idea is to find a strange KPI behavior in time so I need 2 measures:

1. To find if a project has ever had a drop over 30% in a period of a month compared to the previous available month.

2. After filtering a month to be able to see if a project has ever had a drop over 30% compared to the previous available month.
Снимок.PNGСнимок2.PNG
The problem is that periods may vary and each month is not always available for a project.

I hope to use that logic to add different info in the future like "What was the project name that had the drop", "What was the month when the drop happened", "What was the exact deviation", etc.

Thank you very much for any help! 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Try the following formula:

 

% Compare to Previous = 
var Pre_AV_M = 
    MAXX(
        FILTER(
            ALL('Table'),
            'Table'[ProjectID] = MAX('Table'[ProjectID]) 
            && 'Table'[MonthNum] < MAX('Table'[MonthNum])
        ),
        'Table'[MonthNum]
    )
var Pre_Value = 
    CALCULATE( 
        SUM('Table'[KPI]), 
        FILTER(
            ALL('Table'),
            'Table'[ProjectID] = MAX('Table'[ProjectID])
            && 'Table'[MonthNum] = Pre_AV_M
        )
    )
return
    IF(
        Pre_Value <> BLANK(), 
        DIVIDE(
            SUM('Table'[KPI]),
            Pre_Value
        ) - 1
    )
Over30% ID Count = 
CALCULATE(
    DISTINCTCOUNT('Table'[ProjectID]),
    FILTER(
        ALLEXCEPT( 'Table', 'Table'[Date], 'Table'[ProjectID] ),
        [% Compare to Previous] < -0.3
    )
)

vkkfmsft_0-1629708067746.png

vkkfmsft_1-1629708090272.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

3 REPLIES 3
Anonymous
Not applicable

@m3tr01d I will create one for sure. Just started establishing the approach. Have never done such calculations and stuck on it.

Hi @Anonymous ,

 

Try the following formula:

 

% Compare to Previous = 
var Pre_AV_M = 
    MAXX(
        FILTER(
            ALL('Table'),
            'Table'[ProjectID] = MAX('Table'[ProjectID]) 
            && 'Table'[MonthNum] < MAX('Table'[MonthNum])
        ),
        'Table'[MonthNum]
    )
var Pre_Value = 
    CALCULATE( 
        SUM('Table'[KPI]), 
        FILTER(
            ALL('Table'),
            'Table'[ProjectID] = MAX('Table'[ProjectID])
            && 'Table'[MonthNum] = Pre_AV_M
        )
    )
return
    IF(
        Pre_Value <> BLANK(), 
        DIVIDE(
            SUM('Table'[KPI]),
            Pre_Value
        ) - 1
    )
Over30% ID Count = 
CALCULATE(
    DISTINCTCOUNT('Table'[ProjectID]),
    FILTER(
        ALLEXCEPT( 'Table', 'Table'[Date], 'Table'[ProjectID] ),
        [% Compare to Previous] < -0.3
    )
)

vkkfmsft_0-1629708067746.png

vkkfmsft_1-1629708090272.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.

 

 

m3tr01d
Continued Contributor
Continued Contributor

@Anonymous Do you already have a Calendar table in your model?

If not, you'll probably need to have one.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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