Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hola buenos dias
estoy intentando crear una medida que me calcule las ventas MTD hasta hoy
Solved! Go to Solution.
@apc_123 ,
LYMTD QTY forzado=
var _max = fecha (año (hoy())-1,mes(hoy()),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)
@apc_123 , si ha seleccionado una fecha, esto tomará hasta esa fecha. Si no ha seleccionado ninguna fecha, intente
MTD QTY forzado=
var _max = hoy()
devolución
if(max('Date'[Date])<=_max, calculate(Sum('order'[Qty]),DATESMTD('Date'[Date])), blank())
O
calculate(Sum('order'[Qty]),DATESMTD('Date'[Date]),filter('Date','Date'[Date]<=_max))
(TOTALMTD(Sum('order'[Qty]),'Date'[Date]),filter('Date','Date'[Date]<=_max))
Y si quiero calcular el año anterior
Creo que debo calcular el var max_old, por ejemplo
max_Previous_Year = fecha (año (hoy()-1,mes (hoy(),día (hoy())
es correcto ?
@apc_123 ,
LYMTD QTY forzado=
var _max = fecha (año (hoy())-1,mes(hoy()),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)