cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

SamePeriodLastYear is blank

I have a dataset with column for years and another column for unemployment rate. I want to calculate the difference year over year. I tried SamePeriodLastYear but it's giving me blank output.

 

I have done lots of tricks to get a dates column as the original dataset didn't have a dates column but only the years column.

 

Please help.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: SamePeriodLastYear is blank

It works for me.  Note there was one wtone shaped bracket in the orginal formula I posted

 

ly.png



* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

View solution in original post

5 REPLIES 5
Highlighted

Re: SamePeriodLastYear is blank

Assuming you have a year column and a value column

 

this year = sum(table[value])

last year = calculate([this year],filter(all(table[year]),table[year]=max(table[year))-1))



* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
Highlighted
Helper I
Helper I

Re: SamePeriodLastYear is blank

Thanks Matt,

 

I will test it and let you know. Thanks again.

Highlighted
Helper I
Helper I

Re: SamePeriodLastYear is blank

Sorry it didn't work.

 

This is my test data

Unemployment.JPG

 

 

 

Highlighted

Re: SamePeriodLastYear is blank

It works for me.  Note there was one wtone shaped bracket in the orginal formula I posted

 

ly.png



* Matt is a Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.

View solution in original post

Highlighted
Helper I
Helper I

Re: SamePeriodLastYear is blank

Thanks Matt,

 

I will test it and let you know.

 

Appreciate your help on this.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors