cancel
Showing results for
Did you mean:
Highlighted
Regular Visitor

## 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

 dtmFecha Current Period Last Period 2018-01-31 2278340 2018-02-28 2372211 2018-03-31 2314696 2018-04-30 2348998 2018-05-31 2389455 2018-06-30 2415532 2018-07-31 2421830 2018-08-31 2448374 2018-09-30 2466315 2018-10-31 2462091 2018-11-30 2452573 2018-12-31 2505053 2019-01-31 2466777 2278340 2019-02-28 2450665 2372211 2019-03-31 2469268 2314696 2019-04-30 2479956 2348998 2019-05-31 2491616 2389455 2019-06-30 2520659 2415532 2019-07-31 2598913 2421830

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

 dtmDate Current Period Last Period 2019-01-31 2466777 2278340 2019-02-28 2450665 2372211 2019-03-31 2469268 2314696 2019-04-30 2479956 2348998 2019-05-31 2491616 2389455 2019-06-30 2520659 2415532 2019-07-31 2598913 2421830
1 ACCEPTED SOLUTION

Accepted Solutions
Regular Visitor

## Re: SamePeriodLastYear - Show only current year

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 2
Super User IV

## Re: SamePeriodLastYear - Show only current year

Could you restate that question with perhaps some sample data? Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490.

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...

### I have book! Learn Power BI from Packt

Proud to be a Datanaut!

Regular Visitor

## Re: SamePeriodLastYear - Show only current year

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

Announcements

#### Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

#### Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

#### Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!