cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Neill_
Helper III
Helper III

La función DAX de Power BI 'SWITCH' no admite la comparación de valores de tipo True/False

Aparece este error cuando intento crear una columna en Power BI:


La función 'SWITCH' no admite la comparación de valores de tipo True/False con valores de tipo Text. Considere la posibilidad de utilizar la función VALUE o FORMAT para convertir uno de los valores.


¿Cómo soluciono esto?


Aquí está el DAX para la columna que estoy creando:

02_00 001 SSY SKY y AMBOS ?
SWITCH(
TRUE(),
SEARCH("Yes",'looker_tables lkr_Questionnaire'[02_Animals_Processed__003_Have_animals_been_supplied_for_Service_Kill_*846fa9d1-9ac6-4663-b4fc-4298487c7406],"Service Kill",0),
SEARCH("Yes",'looker_tables lkr_Questionnaire'[02_Animals_Processed__004_Have_animals_been_processed_for_Supplementary_supply_*bd69ebd2-f869-4593-b75d-e9bf0f4a8e4f],"Suministro suplementario",0),
SEARCH("1",'looker_tables lkr_Questionnaire'[02_00 002 SSY SKY],"Both",0)
)
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Neill_ , Creo que la fórmula no se utiliza correctamente

Debería ser como

SWITCH(
TRUE(),
SEARCH("Yes",'looker_tables lkr_Questionnaire'[02_Animals_Processed__003_Have_animals_been_supplied_for_Service_Kill_*846fa9d1-9ac6-4663-b4fc-4298487c7406],0) >0,"Service Kill",
SEARCH("Yes",'looker_tables lkr_Questionnaire'[02_Animals_Processed__004_Have_animals_been_processed_for_Supplementary_supply_*bd69ebd2-f869-4593-b75d-e9bf0f4a8e4f],,0)>0,"Suministro suplementario"
BUSCAR("1",'looker_tables lkr_Questionnaire'[02_00 002 SSY SKY],,0) >0,"Ambos"
)

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Neill_ , Creo que la fórmula no se utiliza correctamente

Debería ser como

SWITCH(
TRUE(),
SEARCH("Yes",'looker_tables lkr_Questionnaire'[02_Animals_Processed__003_Have_animals_been_supplied_for_Service_Kill_*846fa9d1-9ac6-4663-b4fc-4298487c7406],0) >0,"Service Kill",
SEARCH("Yes",'looker_tables lkr_Questionnaire'[02_Animals_Processed__004_Have_animals_been_processed_for_Supplementary_supply_*bd69ebd2-f869-4593-b75d-e9bf0f4a8e4f],,0)>0,"Suministro suplementario"
BUSCAR("1",'looker_tables lkr_Questionnaire'[02_00 002 SSY SKY],,0) >0,"Ambos"
)

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors