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! Learn more
¿Cómo convierto esta instrucción de sql a dax?
caso
when dc_q.currency_code ='-1'
luego dc_a.currency_code
Cuando dc_q.currency_code es null
luego dc_a.currency_code
else dc_q.currency_code
end as PNRCurrencyCode,
Gracias por la rápida respuesta. este es el error que obtengo al ingresar la declaración anterior:
La sintaxis de 'dc_q' es incorrecta. (DAX(Switch( True(),(dc_q[currency_code]) ="-1" , dc_a[currency_code],Isblank(dc_q[currency_code)], dc_a[currency_code]dc_q[currency_code]))).
@Ghazaleh , la segunda línea parece tener un problema, por favor encuentre la corrección
Switch( True(),
dc_q[currency_code] ="-1" , dc_a[currency_code],
Isblank( dc_q[currency_code]) , dc_a[currency_code],
dc_q[currency_code]
)
Probé la fórmula anterior y todavía obtengo el error a continuación:
No se puede determinar un valor único para la columna «currency_code» del cuadro «dc_q». Esto puede suceder cuando una fórmula de medida hace referencia a una columna que contiene muchos valores sin especificar una agregación como min, max, count o sum para obtener un solo resultado.
@Ghazaleh , Ver como un nuevo código de columna, use el modificador
PNRCurrencyCode =
Switch( True(),
dc_q[currency_code] ="-1" , dc_a[currency_code],
Isblank(dc_q[currency_code)], dc_a[currency_code]
dc_q[currency_code]
)
Declaración de #PowerBI de Switch-Case: https://www.youtube.com/watch?v=gelJWktlR80&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=56
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.