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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Syndicate_Admin
Administrator
Administrator

mes actual y anterior en una sola columna

explicando por qué esta columna calculada solo evalúa para el mes actual y no para el mes y año anteriores.

Período =
INTERRUPTOR(formato(vwCalenderTable[La Fecha],"aaaaMM"),
formato(vwCalenderTable[hoy],"aaaaMM"),vwCalenderTable[ShortMonthYear],
formato(FECHAADD(INICIODEMONIO(vwCalenderTable[hoy]),-1,MES),"aaaaMM"),"Mes anterior",
formato(FECHAADD(INICIODEMONIO(vwCalenderTable[hoy]),-12,MES),"aaaaMM"),"Mismo período del año anterior",
Espacio en blanco())
Quiero usar esta columna en una leyenda de serie temporal para mostrar períodos actuales y anteriores contra el día del mes.
2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Hola

Utilice el siguiente código para su columna:

Período = Interruptor(formato(Hoja159[lafecha],"aaaaMM"),
formato(Hoja159[Hoy],"aaaaMM"),Hoja159[ShortMonthYear],
Formato(eomonth(Hoy(),-1), "aaaaMM"),"Mes anterior",
Formato(eomonth(Hoy(),-12), "aaaaMM"),"Mismo período anterior",
Espacio en blanco()
)
MahyarTF_0-1662433961182.png

aprecia sus felicitaciones

Syndicate_Admin
Administrator
Administrator

@adin , Puede crear una columna como , Supongamos que tiene una columna de fecha

Tipo de mes = Switch( True(),
eomonth([Fecha],0) = eomonth(Today(),-1*mes(Today())),"Last year Last Month" ,
eomonth([Fecha],0) = eomonth(Hoy(),-1),"Último mes" ,
eomonth([Fecha],0)= eomonth(Hoy(),0),"Este Mes" ,
Formato([fecha],"AAAA-MM")
)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors
Top Kudoed Authors