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

SQL a DAX

¡Hola a todos! ¿Cómo se convierte este querry en DAX?

Quiero estandarizar queuries y esperaba que fuera posible tener este como una medida / tabla (s).

CON cte_elevation AS (

seleccionar well_id, SUM(datum_elevation) * -0.3048 AS elevación

de CD_DATUM

donde is_default 'Y'

grupo por well_id

)

,cte_plan AS (

SELECT wp.well_id, 'Plan' como Tipo, (wp.md_to * -0.3048) + elevación COMO Profundidad

,cast(sum(isnull(wp.target_duration,0)) over (partición por orden wp.well_id por cast(step_no as smallint)) como horas

,cast(step_no como int) AS OrderBy

DE dbo. DM_WELL_PLAN_OP wp

UNIRSE a cte_elevation e ON wp.well_id e.well_id

DONDE target_duration no es nula

Y md_to no es nula

)

,cte_actual AS (

SELECT d.well_id, Tipo AS 'Real', (d.md_current * -0.3048) + e.elevation AS Depth

,isnull(days_on_location,0) * 24 como horas

,CAST(date_report como int) AS OrderBy

DE dbo. DM_DAILY d

UNIRSE a cte_elevation e ON d.well_id e.well_id

)

SELECCIONAR * DE cte_plan

UNION ALL

SELECCIONAR * DE cte_actual

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

@Alex_0201 , Ver si este blog puede ayudarle a construir este

https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/

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