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
Syndicate_Admin
Administrator
Administrator

Convertir varias instrucciones case en SQL a DAX

Hola a todos,

Necesito ayuda para convertir las siguientes instrucciones de caso a dax.

Caso

CUANDO ([SCODE]) = 47123

THEN((([Total Real]+1350)+Caso cuando isnull([Total Budget_Food]) luego (-1*[Presupuesto Total]) else [Total Budget_Food] END)/[Total ComparedOcc_FB]*[Max Negation])/(((Caso cuando isnull([Total Budget_Food]) luego (-1*[Total Presupuesto]) else [Total Budget_Food] END)/[Total Compared_Occ_FB])

ELSE(([Total real]+Caso cuando isnull([Total Budget_Food]) luego (-1*[Presupuesto total]) else [Total Budget_Food] END)/[Total Compared_Occ_FB]*[Max Negation])/((Caso cuando isnull([Total Budget_Food]) luego (-1*[Presupuesto total]) else [Total Budget_Food] END)/[Total Compared_Occ_FB])

Fin

Su ayuda será muy apreciada.

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

@woleada20,

¿Las sugerencias anteriores ayudaron con su escenario? si ese es el caso, puede considerar Kudo o Aceptar las sugerencias útiles para ayudar a otros que enfrentaron requisitos similares.

Si esto tampoco ayuda, comparta información más detallada para ayudarnos a aclarar su escenario para probar.

Cómo obtener respuestas a su pregunta rápidamente

Saludos

Xiaoxin Sheng

Syndicate_Admin
Administrator
Administrator

@woleada20 , Puede usar Switch con True

ejemplo

Switch(True() ,

[CÓDIGO SCODE]) = 47123 , [Total real]+1350 ,

isblank([Total Budget_Food]) , -1*[Presupuesto total],

divide([Total Budget_Food] END), [Total ComparedOcc_FB]*[Max Negation])

)

De la misma manera, puede agregar otro modificador verdadero

Declaración de #PowerBI Switch-Case: https://www.youtube.com/watch?v=gelJWktlR80&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=56

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.