Forum Discussion

charlyrosero's avatar
charlyrosero
Frequent Visitor
7 years ago
Solved

SamePeriodLastYear - Show only current year

Hi 

 

i have a measure that calculate the same period of last year. but now only i need to show the current year (2019) in a graph with the measure which calculate the values for the periods of last year. 

 

Last Period = IF(ISBLANK([Current Period]) , BLANK(),CALCULATE([Current Period],SAMEPERIODLASTYEAR(DimTiempo[dtmFecha])))

this is my data set, i use a dimension time 

 

dtmFechaCurrent PeriodLast Period
2018-01-312278340 
2018-02-282372211 
2018-03-312314696 
2018-04-302348998 
2018-05-312389455 
2018-06-302415532 
2018-07-312421830 
2018-08-312448374 
2018-09-302466315 
2018-10-312462091 
2018-11-302452573 
2018-12-312505053 
2019-01-3124667772278340
2019-02-2824506652372211
2019-03-3124692682314696
2019-04-3024799562348998
2019-05-3124916162389455
2019-06-3025206592415532
2019-07-3125989132421830

 

how can i do that ? only show the data for current year (2019)

 

dtmDateCurrent PeriodLast Period
2019-01-3124667772278340
2019-02-2824506652372211
2019-03-3124692682314696
2019-04-3024799562348998
2019-05-3124916162389455
2019-06-3025206592415532
2019-07-3125989132421830
  • The solution was simply add a filter in last period measure with the condition is not blank. as simple as this. thank you so much 

2 Replies