Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Marcus352
Regular Visitor

Same Period Last Year for two field

Hi all,

I'm having trouble with the following.

With the Snapshot date being exactly one year apart, I want to compare 2020 data with 2019 intake year data.

As an example,
28,926 vs 24,320 

Marcus352_0-1665537190847.png

I am unable to construct a formula for it. Could someone please help?

 

Thanks,

Marcus

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Could you share data in a format that can be pasted in an MS Excel file and also describe the question.  What is snapshot date?  Please also show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Sure. 

Snapshot date is the time the information was entered into our database.
Please refer to the table below for the excel format.

Snapshot Date2019Expected Result2020
31/12/2019     28,926               24,320     19,549
31/12/2020             -        24,320
17/06/2021             -                -  
5/08/2021             -                -  
31/12/2021             -                -  
17/06/2022             -                -  


What I need is the expected result column.

Please be aware that Snapshot date and Intake Year are two separate fields that originate from the same table.

amitchandak
Super User
Super User

@Marcus352 , Make sure you are using date table, Both Date and year are coming from Date in visual

 

Try meausres like

 

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

 

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

 

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

I appreciate your prompt response, Amit.
Snapshot dates and Intake year are 2 separate fields. They do indeed originate from the same table.
I tried using your formula, but the outcome is not what I wanted.
Please see the expected outcome. Thanks in advance.

 

Snapshot Date2019Expected Result2020
31/12/2019     28,926               24,320     19,549
31/12/2020             -        24,320
17/06/2021             -                -  
5/08/2021             -                -  
31/12/2021             -                -  
17/06/2022             -                -  

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.