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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
smjzahid
Helper V
Helper V

Switch True throwing error (A table of multiple values was supplied)

I have measure like the one below, formatted as Currency

[PAIN / GAIN ALL] = CALCULATE([PAIN / GAIN],ALL(dimpartner))

 

[PAIN / GAIN] = CALCULATE(([Current Target]-[Current AFC]),FILTER(dimpartner,dimpartner[Partner Type]<>"Tier 2"))

 I am trying to add a SWITCH ( TRUE () logic to achieve the result, However I am getting below shown error.

 

I have below items in my table named 'dimpartner'[Partner] column  in DAX Studio it shows below values in partner column

EVALUATE(VALUES(dimpartner[Partner]))

smjzahid_0-1673434701512.png

Here is the error Power BI desktop throws and here is the Measure I have written

 

Alliance Members Pain / Gain Share with Switch 2 =
SWITCH (
    TRUE (),
    [PAIN / GAIN ALL] > 6000000
        && VALUES ( dimpartner[Partner] ) = "NetworkRail", [First 6M Gain to Network Rail],
    [PAIN / GAIN ALL] > 6000000
        && VALUES ( dimpartner[Partner] ) = "Murphys", [Percentage of Works Value],
    0
)

 

smjzahid_1-1673435020453.png

 

1 REPLY 1
Samarth_18
Community Champion
Community Champion

Hi @smjzahid ,

 

To give the correct answer other info is also required but in the meantime you can try below code:-

Alliance Members Pain / Gain Share with Switch 2 =
SWITCH (
    TRUE (),
    [PAIN / GAIN ALL] > 6000000
        && MAX ( dimpartner[Partner] ) = "NetworkRail", [First 6M Gain to Network Rail],
    [PAIN / GAIN ALL] > 6000000
        && MAX ( dimpartner[Partner] ) = "Murphys", [Percentage of Works Value],
    0
)

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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