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! Request now
Hi Team,
Kindly help me applying this DAX query - SWITCH Case
Solved! Go to Solution.
Your first argument in your SWITCH is a table. It needs to be a single scalar value.
I'd suggest reworking your measure like this:
Measure1 =
VAR Budget =
CALCULATE (
SUM ( 'Raw Data'[Budget] ),
KEEPFILTERS ( 'Raw Data'[Year] = 2020 )
) / 1000000
RETURN
SWITCH (
SELECTEDVALUE ( 'Raw Data'[Market Tier - Budget location] ),
"T40 (Incl US)",
CALCULATE (
SUM ( Categories_US_Final[TOTAL] ),
KEEPFILTERS ( Categories_US_Final[Categories] = "TOTALS" ),
KEEPFILTERS ( Categories_US_Final[Year] = "2020" )
) + Budget,
Budget
)
Your first argument in your SWITCH is a table. It needs to be a single scalar value.
I'd suggest reworking your measure like this:
Measure1 =
VAR Budget =
CALCULATE (
SUM ( 'Raw Data'[Budget] ),
KEEPFILTERS ( 'Raw Data'[Year] = 2020 )
) / 1000000
RETURN
SWITCH (
SELECTEDVALUE ( 'Raw Data'[Market Tier - Budget location] ),
"T40 (Incl US)",
CALCULATE (
SUM ( Categories_US_Final[TOTAL] ),
KEEPFILTERS ( Categories_US_Final[Categories] = "TOTALS" ),
KEEPFILTERS ( Categories_US_Final[Year] = "2020" )
) + Budget,
Budget
)
Thank a lot for quick response. It's helpful.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 13 | |
| 10 | |
| 8 |