Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hola
Estoy tratando de crear una identificación con 1 y 2 de la fecha máxima y mínima (1=Min y 2=Max).
Tabla 2:
Pedido mensual
Abril 2023 1
Mayo 2023 2
Preferiblemente en Power Query
No funcionó, lo agregué en el editor avanzado, ¿tal vez haciendo paso a paso?
o prueba esto
let
YearNow = Date.Year( DateTime.LocalNow()),
MonthNow = Date.Month( DateTime.LocalNow()),
date1 =#date(YearNow,MonthNow-2,1) ,
date2 =#date(YearNow,MonthNow-1,1) ,
date3= #date(YearNow,MonthNow,1) ,
Source = #table(type table [Month=date, Order=Int64.Type],
{
{date1,1},{date2,2},{date3,3}
})
in
Source
Por favor, pruebe esto
let
DateNow = List.Transform( List.Generate(()=> Date.AddMonths( Date.From( DateTime.LocalNow()),-2),
(x) => x <= Date.From( DateTime.LocalNow()),
(x) => Date.AddMonths(x,1)), (x) => Date.StartOfMonth(x)),
#"Converted to Table" = Table.FromList(DateNow, Splitter.SplitByNothing(), {"Month"}, null, ExtraValues.Error),
#"Added Index" = Table.AddIndexColumn(#"Converted to Table", "Order", 1, 1, Int64.Type)
in
#"Added Index"
Este mes JUNIO 2023 tiene ABRIL 2023 y MAYO 2023, el próximo mes
JULIO 2023 tendrá MAYO 2023 y JUNIO 2023, el próximo mes
AGOSTO 2923 tendrá JUNIO 2023 y JULIO 2023...
Siempre estará cambiando
¿Qué quieres decir dinámico? mes actual y mes anterior?
En este caso, el mes será dinámico, no siempre serán esos meses.
En ese caso, puede hacer esto:
let
Source = List.Generate( ()=> #date(2023,1,1),
(x) => x<= #date(2023,12,1),
(x)=> Date.AddMonths(x,1)
),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), {"Month"}, null, ExtraValues.Error),
#"Added Index" = Table.AddIndexColumn(#"Converted to Table", "Order", 1, 1, Int64.Type)
in
#"Added Index"
Hola
¿Qué pasa si hay 12 filas (una para cada mes)? ¿Cuál debería ser el resultado?
Por favor, pruebe esto
let
Source = #table(type table [Month=date, Order=Int64.Type], {{#date(2023,4,1),1},{#date(2023,5,1),2}})
in
Source
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.