This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
¡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
@Alex_0201 , Ver si este blog puede ayudarle a construir este
https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.