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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Kudoed Authors