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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Switch Measure error

Hi Experts

 

Cannot see my error in the following switch Measure - Has the siwitch function been composed correctly???

 

Measure_Switch = 
If(Hasonevalue(Table[Type]),
Switch(Selectedvalue(Table[Type]),

"Under 18",[Under_18],
"18+",([18+] + [52+] + [64+] + [70+] + [78+] + [90+] + [104]),
"52+",([52+] + [64+] + [70+] + [78+] + [90+] + [104]),
"64+",([64+] + [70+] + [78+] + [90+] + [104]),
"70+",([70+] + [78+] + [90+] + [104]),
"78+",([78+] + [90+] + [104]),
"90+",([90+] + [104]),
"104+",([104]),
"Clock Stop",[Clock_Stops],
Blank()
)

1 ACCEPTED SOLUTION
keshavagrawal27
Resolver I
Resolver I

Hello @Anonymous,

We cannot add measures like you did in switch.

Please create variables to do the addition and then use thode variables in switch.

 

Please mark it as solution if it helped you.

 

Regards,

Keshav Agrawal

View solution in original post

1 REPLY 1
keshavagrawal27
Resolver I
Resolver I

Hello @Anonymous,

We cannot add measures like you did in switch.

Please create variables to do the addition and then use thode variables in switch.

 

Please mark it as solution if it helped you.

 

Regards,

Keshav Agrawal

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.