Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hola a todos,
Estoy teniendo un poco de troube convirtiendo una columna calculada DAX a M.
Sería bueno tenerlo para una cuestión de tener que trabajar de una mejor manera (para hacer apéndices posteriores, etc.).
La columna calculada DAX es la siguiente:
Value =
VAR __WorkingDaysRow =
CALCULATE (
//The workday column is 1 or 0, according if it is a workday or not
SUM ( 'Date'[Workday] ),
DATESBETWEEN (
'Date'[Date],
MAX (
//the 'Demand - Facts'[Month] is always the first day of the month
'Demand - Facts'[Month],
'Demand - Facts'[From]
),
MIN (
NEXTMONTH ( 'Demand - Facts'[Month] ) - 1,
'Demand - Facts'[To]
)
)
)
VAR __WorkingDaysMonth =
CALCULATE (
SUM ( 'Date'[Workday] ),
DATESBETWEEN (
'Date'[Date],
'Demand - Facts'[Month],
NEXTMONTH ( 'Demand - Facts'[Month] ) - 1
)
)
RETURN
DIVIDE ( __WorkingDaysRow, __WorkingDaysMonth, 0 )*'Demand - Facts'[Value per Demand]
//Demand - Facts'[Value per Demand] is the FTE for each row/activity
Básicamente, tengo algunas actividades con una fecha "De" y "Para". Calculo para cada mes el número de días laborables y luego calculo los FTEs por cada mes en consecuencia a los FTEs para toda la actividad.
Ahora, quería crear esto en M.
Ya he creado una tabla "Días laborables" en Power Query, con la correspondencia de 0/1 para cada día laborable.
Así que, básicamente, quería una fórmula en M que:
Gracias por tu ayuda,
Pedro
No suena como una columna calculada o el código M es útil aquí. Lo que puede hacer es incluir una columna en la tabla de calendario que tenga días laborables al mes, pero eso es algo que debe definir fuera de Power BI.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |