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
Nick2358
Helper III
Helper III

Automatizar la transición de fecha en medida

Hola a todos,

Este es mi problema hoy. Estamos integrando uno de nuestros informes en Power BI y una de nuestras pestañas muestra el número real YTD + Presupuesto de meses restantes en una matriz.

La cosa es que desde sus números financieros estamos 2 meses detrás del mes actual (actualmente YTD Actual es hasta octubre y el presupuesto está mostrando noviembre + diciembre).

Gracias a la ayuda de alguien en este foro tengo la siguiente medida que me permite mostrar Actual + Budget en una matriz. Sin embargo, me preguntaba si esto se puede modificar, así que no tengo que cambiar manualmente el "var" cada mes?

Act + Bdgt ?
var _max1 á MAXX(ALLSELECTED(Dates),Dates[Date_2])
var _max á EOMONTH(DATE(YEAR(_max1), MONTH(_max1)-2.1),0)
var _min - DATE(YEAR(_max1),1,1)
var _minb - DATE(YEAR(_max1), MONTH(_max1)-2,1)
var _maxb - DATE(YEAR(_max1), 12,31)
devolución
CALCULATE(SUM('Conso Bdgt 2020'[Valor]), FILTER(Dates, Dates[Date_2] <-_max && Dates[Date_2] >-_min))
+ CALCULATE(SUM('Calculation_Conso Bdgt 2020'[Valor]), FILTER(Dates, Dates[Date_2]<-_maxb && Dates[Date_2]>-_minb))
Muchas gracias por tu ayuda,
Nick
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Nick2358 , ¿qué var tienes que modificar?

puedes intentarlo como.

Act + Bdgt ?
var _max1 á MAXX(ALLSELECTED(Dates),Dates[Date_2])
var _max - EOMONTH(_max1,-2)
var _min - DATE(YEAR(_max1),1,1)
var _minb - EOMONTH(_max1,-2)+1
var _maxb - DATE(YEAR(_max1), 12,31)
devolución
CALCULATE(SUM('Conso Bdgt 2020'[Valor]), FILTER(Dates, Dates[Date_2] <-_max && Dates[Date_2] >-_min))
+ CALCULATE(SUM('Calculation_Conso Bdgt 2020'[Valor]), FILTER(Dates, Dates[Date_2]<-_maxb && Dates[Date_2]>-_minb))

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Nick2358 , ¿qué var tienes que modificar?

puedes intentarlo como.

Act + Bdgt ?
var _max1 á MAXX(ALLSELECTED(Dates),Dates[Date_2])
var _max - EOMONTH(_max1,-2)
var _min - DATE(YEAR(_max1),1,1)
var _minb - EOMONTH(_max1,-2)+1
var _maxb - DATE(YEAR(_max1), 12,31)
devolución
CALCULATE(SUM('Conso Bdgt 2020'[Valor]), FILTER(Dates, Dates[Date_2] <-_max && Dates[Date_2] >-_min))
+ CALCULATE(SUM('Calculation_Conso Bdgt 2020'[Valor]), FILTER(Dates, Dates[Date_2]<-_maxb && Dates[Date_2]>-_minb))

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.