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.
Estoy tratando de calcular las horas facturables MTD y me preguntaba si la siguiente medida para calcular las horas facturables anteriores del mes pasado podría formatearse para funcionar
Horas facturables del último mes =
VAR PreviousMonths=1
VAR SelYear = Si(MES(HOY())-MesesAnteriores<=0, AÑO(HOY())-1, AÑO(HOY()))
VAR SelMonth= IF(MONTH(TODAY())-PreviousMonths<=0, MONTH(TODAY())-PreviousMonths +12, MONTH(TODAY())-PreviousMonths)
VAR SelDay= DÍA(HOY())
VAR SelMonthDay = FORMAT(DATE(SelYear,SelMonth,SelDay), "MMMM AAAA")
Devolución
CALCULATE([Chargeable Hours], FILTER('Work Date', 'Work Date'[Calendar Month Of Year]=SelMonthDay))
MTD= calculate(Sum('order'[Qty]),DATESMTD('Date'[Date]))
LMTD =CALCULATE(Sum('order'[Qty]),DATESMTD(dateadd('Date'[Date],-1,year)))
Puede completar si el mes completo está dentro del alcance
LMTD QTY forzado =
var _max = fecha(año(hoy()),mes(hoy())-1,día(hoy()))
devolución
if(max('Date'[Date])<=_max, CALCULATE(Sum('order'[Qty]),DATESMTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max), blank())
O
CALCULATE(Sum('order'[Qty]),DATESMTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max)
TOTALMTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year),'Date'[Date]<=_max)
LMTD QTY forzado =
Var _Maxdate = MAX('Tabla de fechas'[Fecha])
var _max = fecha(año(_Maxdate),mes(_Maxdate)-1,día(_Maxdate))
devolución
if(max('Date'[Date])<=_max, CALCULATE(Sum('order'[Qty]),DATESMTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max), blank())
O
CALCULATE(Sum('order'[Qty]),DATESMTD(dateadd('Date'[Date],-1,year)),'Date'[Date]<=_max)
TOTALMTD(Sum('order'[Qty]),dateadd('Date'[Date],-1,year),'Date'[Date]<=_max)
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 |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |