cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Floriankx Solution Sage
Solution Sage

Last Year / Sameperiodlastyear with year column

Hello together,

 

I have a table which contains a year column, no date.

I know I can transfer each year to January 1st as date. But then the list is still not contigous date columns as required by the formulas.

 

Do you know any other possibility to create the Reporting Value of 2014 if 2015 is filtered?

 

Actually it is Report_Value:=Sum([Values])
But Report_Value_LastYear ist quite more difficult.

 

If tried something like this CALCULATE([Report_Value];FILTER(KoA;KoA[Jahr]=[Max Jahr]-1)) but it did not work.

 

Maybe you have an idea.

 

Best regards

1 ACCEPTED SOLUTION

Accepted Solutions
waltheed Solution Supplier
Solution Supplier

Re: Last Year / Sameperiodlastyear with year column

The recommmended approach is to create a date dimension table and use that for time intelligence functions. But I figured this out:

 

Create a calculated column and add this formula:
Value Prev Year = CALCULATE(Sum(Table1[Value]), filter(Table1, Table1[Year]+1 = earlier(Table1[Year])))

 

Capture.PNG

 Does that work for you?

Cheers, Edgar Walther
Power BI User Group Netherlands

View solution in original post

2 REPLIES 2
waltheed Solution Supplier
Solution Supplier

Re: Last Year / Sameperiodlastyear with year column

The recommmended approach is to create a date dimension table and use that for time intelligence functions. But I figured this out:

 

Create a calculated column and add this formula:
Value Prev Year = CALCULATE(Sum(Table1[Value]), filter(Table1, Table1[Year]+1 = earlier(Table1[Year])))

 

Capture.PNG

 Does that work for you?

Cheers, Edgar Walther
Power BI User Group Netherlands

View solution in original post

Floriankx Solution Sage
Solution Sage

Re: Last Year / Sameperiodlastyear with year column

Hello,

 

yes it worked,

 

I couldn't figure out how to do it with earlier. I had to add a second filter with EARLIER because I have several rows per year.

But now it works. I just have to make sure there is a value for each value and year so I had to erase my '<>0' filter out of my query.

 

Best regards

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors