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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Complicated Calculation (Please Help)

Hi Everyone,

 

Please help me on this - is this possible to be done? 

 

Scenario 1: 

when the business transformation filter to single activity (activity 1) : 

 

impact on workload: -60%

impact year starts from: 2022 and onwards: 

 

2020: no impact
2021: no impact
2022 - 2030: base * 0.4 

 

Scenario 2:

when the business transformation filter to mulitple activities (activity 1 and 2) : 

thekimberlytan_2-1619706586597.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Based on your description, you can create a measure as follows.

Test_measure =
VAR x0 =
    SELECTEDVALUE ( ACT[Activity] )
VAR x1 =
    SWITCH (
        TRUE (),
        MAX ( 'Test_activity'[Year] ) <= 2021, MAX ( 'Test_activity'[units] ),
        MAX ( 'Test_activity'[units] ) * 0.4
    )
VAR x2 =
    SWITCH (
        TRUE (),
        MAX ( 'Test_activity'[Year] ) <= 2021, MAX ( 'Test_activity'[units] ),
        MAX ( 'Test_activity'[Year] ) >= 2025,
            MAX ( 'Test_activity'[units] ) * 0.4 * 0.8,
        MAX ( 'Test_activity'[units] ) * 0.4
    )
RETURN
    IF (
        ISFILTERED ( ACT[Activity] ),
        IF (
            x0 = "activity 1",
            x1,
            IF (
                x0 = "activity 2",
                BLANK (),
                IF (
                    COUNTROWS ( ALLSELECTED ( ACT[Activity] ) ) = DISTINCTCOUNT ( ACT[Activity] ),
                    x2,
                    BLANK ()
                )
            )
        ),
        BLANK ()
    )

Result:

050402.gif

Hope that's what you were looking for.

Best Regards,

Yuna

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

Based on your description, you can create a measure as follows.

Test_measure =
VAR x0 =
    SELECTEDVALUE ( ACT[Activity] )
VAR x1 =
    SWITCH (
        TRUE (),
        MAX ( 'Test_activity'[Year] ) <= 2021, MAX ( 'Test_activity'[units] ),
        MAX ( 'Test_activity'[units] ) * 0.4
    )
VAR x2 =
    SWITCH (
        TRUE (),
        MAX ( 'Test_activity'[Year] ) <= 2021, MAX ( 'Test_activity'[units] ),
        MAX ( 'Test_activity'[Year] ) >= 2025,
            MAX ( 'Test_activity'[units] ) * 0.4 * 0.8,
        MAX ( 'Test_activity'[units] ) * 0.4
    )
RETURN
    IF (
        ISFILTERED ( ACT[Activity] ),
        IF (
            x0 = "activity 1",
            x1,
            IF (
                x0 = "activity 2",
                BLANK (),
                IF (
                    COUNTROWS ( ALLSELECTED ( ACT[Activity] ) ) = DISTINCTCOUNT ( ACT[Activity] ),
                    x2,
                    BLANK ()
                )
            )
        ),
        BLANK ()
    )

Result:

050402.gif

Hope that's what you were looking for.

Best Regards,

Yuna

 

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

 

amitchandak
Super User
Super User

@Anonymous ,based on what I got

 

Layer one seem seem like

new column =

if([Year] >=2022, [Base]*.4 , [Base])

 

layer seems like a new column

Switch( true() ,

[Year] >=2025, [Base]*.6

[Year] >=2022, [Base]*.4 ,

[Base]

)

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.