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
ogend
Helper I
Helper I

Populate a table with Prior Year values only with time intelligence

Hi BI Gurus, 

I have a table :

PeriodScenarioDepartment Revenue
Dec-17Actualdepartment1500
Mar-18Forecastdepartment1550
Jun-18Forecastdepartment1600
Sep-18Forecastdepartment1500
Dec-18Forecastdepartment1530
Dec-18Actualdepartment1535
Mar-19Forecastdepartment1580
Jun-19Forecastdepartment1600
Sep-19Forecastdepartment1620
Dec-19Forecastdepartment1590
Dec-19Actualdepartment1600
Mar-20Forecastdepartment1620
Jun-20Forecastdepartment1630
Sep-20Forecastdepartment1620
Dec-20Forecastdepartment1610
Dec-20Actualdepartment1600
Dec-17Actualdepartment2575
Mar-18Forecastdepartment2633
Jun-18Forecastdepartment2690
Sep-18Forecastdepartment2575
Dec-18Forecastdepartment2610
Dec-18Actualdepartment2615
Mar-19Forecastdepartment2667
Jun-19Forecastdepartment2690
Sep-19Forecastdepartment2713
Dec-19Forecastdepartment2679
Dec-19Actualdepartment2690
Mar-20Forecastdepartment2713
Jun-20Forecastdepartment2725
Sep-20Forecastdepartment2713
Dec-20Forecastdepartment2702
Dec-20Actualdepartment2700
Dec-19Actualdepartment 3345
Mar-20Forecastdepartment 3357
Jun-20Forecastdepartment 3362
Sep-20Forecastdepartment 3357
Dec-20Forecastdepartment 3351
Dec-20Actualdepartment 3350

 

my goal is to get to this view  so that Current year is picked from a slicer and prior year is dinamically calculated  as curent year - 1

 PYForecast03Forecast06Forecast09Forecast12CY
department1600620630620610600
department2690713725713702700
department 3345356.5362.25356.5350.75350

 

I was able to get to this by setting up a date table and using the year from the date table in the slicer.

 

I now need to populate a separate table with all records for Prior Year only (Year selected in the slicer minus 1)

I thought it's be straighforward with SUMMARIZE or CALCULATETABLE and using SAMEPERIODLASTYEAR or PREVIOUSYEAR, but this doesn't seem to work . I also tried this with DATEADD, but no luck either. I am super new to Power BI, could be that I am not using those forumals correctly. Would you be able to help?

 

Thanks!

Olga

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ogend , I am hoping you have a date column else create a new one like

 

Date = "01-" & [Period] //Change data type to date.

 

You can create measure with help from time intelligence

example

Last YTD Sales = CALCULATE(SUM(Table[Revenue]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

 

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@ogend , I am hoping you have a date column else create a new one like

 

Date = "01-" & [Period] //Change data type to date.

 

You can create measure with help from time intelligence

example

Last YTD Sales = CALCULATE(SUM(Table[Revenue]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

 

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.