cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper I

## SWITCH TRUE/FALSE WITH TEXT ERROR

Hi, i currently have the following measure for a card:

This returns the error from the title. What am i doing wrong here? The conditions i'm telling SWITCH are all INT and i can't spot the error.

2 ACCEPTED SOLUTIONS
Community Champion

Hi @Gonqq ,

in your SWITCH() function you need two arguments, first is the condition and second the return value if the condition is true. The conditon of the marked part is missing.

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Community Support

Hi  @Gonqq ,

You can modify Measure as follows:

``````Ano N+1 =
var _Y=SELECTEDVALUE('Calendarion'[Ano])
var _P=SELECTEDVALUE('Periodo Reg ID'[Periodo Repoert Num])
return
IF(
_P=20222025,"2021 Real",
IF(_P=20212025 && _Y > 2021 ,"2021 Real","2021 PJ")
)``````

Result：

Best Regards,

Liu Yang

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

2 REPLIES 2
Community Support

Hi  @Gonqq ,

You can modify Measure as follows:

``````Ano N+1 =
var _Y=SELECTEDVALUE('Calendarion'[Ano])
var _P=SELECTEDVALUE('Periodo Reg ID'[Periodo Repoert Num])
return
IF(
_P=20222025,"2021 Real",
IF(_P=20212025 && _Y > 2021 ,"2021 Real","2021 PJ")
)``````

Result：

Best Regards,

Liu Yang

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

Community Champion

Hi @Gonqq ,

in your SWITCH() function you need two arguments, first is the condition and second the return value if the condition is true. The conditon of the marked part is missing.

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Announcements