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

Previous Year & Current Year total sales calculation

Hi All,

 

How to calculate the total sales happened in pervious year & current year?

 

 

 

Regards,

Manivannan M

1 ACCEPTED SOLUTION
GilbertQ
Super User
Super User

Hi @Manivannan

 

In order to do this you will first need to create a Date table and map it to your existing dataset.

Here is a link below on how to create the table: https://www.fourmoo.com/2016/09/13/power-bi-how-to-easily-create-dynamic-date-tabledimension-with-fi...

 

Once that is done you can then use the build in Time Intelligence features to calculate the Current and Previous Year Totals with the DAX measure examples below, where you would put the columns from the date table into your visual or table.

 

Sales = SUM('My Table'[Sales Amounts])

PY - Sales = CALCULATE([Sales],PREVIOUSYEAR('Date'[Calendar Date]))

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

1 REPLY 1
GilbertQ
Super User
Super User

Hi @Manivannan

 

In order to do this you will first need to create a Date table and map it to your existing dataset.

Here is a link below on how to create the table: https://www.fourmoo.com/2016/09/13/power-bi-how-to-easily-create-dynamic-date-tabledimension-with-fi...

 

Once that is done you can then use the build in Time Intelligence features to calculate the Current and Previous Year Totals with the DAX measure examples below, where you would put the columns from the date table into your visual or table.

 

Sales = SUM('My Table'[Sales Amounts])

PY - Sales = CALCULATE([Sales],PREVIOUSYEAR('Date'[Calendar Date]))

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

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.