Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi All
Solved! Go to Solution.
Hi @admin11 ,
It would be like this:-
_amount_select3 =
VAR VAR1 =
    SUM ( 'SALES'[sales] )
RETURN
    SWITCH (
        SELECTEDVALUE ( SliceTable[Slice] ),
        "BRAND_C",
            IF (
                ISINSCOPE ( summrizetable2[rank] ),
                CALCULATE ( VAR1 ),
                FILTER (
                    ALLSELECTED ( 'SALES' ),
                    [BRAND_C] = MAX ( 'summrizeTable1'[BRAND_C] )
                )
            ),
        VAR1
    )
Thanks,
Samarth
Best Regards,
  Samarth
 
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @admin11 ,
It would be like this:-
_amount_select3 =
VAR VAR1 =
    SUM ( 'SALES'[sales] )
RETURN
    SWITCH (
        SELECTEDVALUE ( SliceTable[Slice] ),
        "BRAND_C",
            IF (
                ISINSCOPE ( summrizetable2[rank] ),
                CALCULATE ( VAR1 ),
                FILTER (
                    ALLSELECTED ( 'SALES' ),
                    [BRAND_C] = MAX ( 'summrizeTable1'[BRAND_C] )
                )
            ),
        VAR1
    )
Thanks,
Samarth
Best Regards,
  Samarth
 
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
@admin11 ,Please try this:-
_amount_select3 =
SWITCH (
    SELECTEDVALUE ( SliceTable[Slice] ),
    "BRAND_C",
        IF (
            ISINSCOPE ( summrizetable2[rank] ),
            CALCULATE (
                VAR1,
                FILTER (
                    ALLSELECTED ( 'SALES' ),
                    [BRAND_C] = MAX ( 'summrizeTable1'[BRAND_C] )
                )
            ),
            VAR1
        )
)
Best Regards,
  Samarth
 
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
i Just notice that all row return same value.
Hope you can advise me where go wrong ?
Paul
Small correction. Please try this:-
_amount_select3 =
VAR VAR1 =
    SUM ( 'SALES'[sales] )
RETURN
    SWITCH (
        SELECTEDVALUE ( SliceTable[Slice] ),
        "BRAND_C",
            IF (
                ISINSCOPE ( summrizetable2[rank] ),
                CALCULATE (
                    VAR1,
                    FILTER (
                        ALLSELECTED ( 'SALES' ),
                        [BRAND_C] = MAX ( 'summrizeTable1'[BRAND_C] )
                    )
                )
            ),
        VAR1
    )
Best Regards,
  Samarth
 
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
@admin11 is it possible for you to share your PBIX file after removing sensitive data since its bit difficult to answer without seeing data.
Is it working fine without variable?
Best Regards,
  Samarth
 
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.