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

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.

Reply
Syndicate_Admin
Administrator
Administrator

Horas facturables de MTD

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))

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

@kari1282 ,

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)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.