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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

DAX Sales for current year less 2

Hi Experts

 

I want to amend the current measure to give me the sale for 2019 (less 2 years) the current measure return the sameperiodlastyear. I want the new measure to give same period less 2 years.

 

NetSales YoY% =
VAR CY = [Overall NS]

VAR PY = Calculate([Overall NS],SAMEPERIODLASTYEAR(Calendar[Date], ALL(Calendar))

Return
Divde (CY - PY, PY,0)

 

1 ACCEPTED SOLUTION
goncalogeraldes
Super User
Super User

Hello there @Anonymous ! Maybe this can work:

NetSales YoY% =
VAR CY = [Overall NS]

VAR PY = Calculate([Overall NS],PARALLELPERIOD(Calendar[Date], -2, YEAR))

Return
Divde (CY - PY, PY,0)

 

Hope this answer solves your problem! If you need any additional help please tag me in your reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️ or give it a kudoe 👍
Thanks!

Best regards,
Gonçalo Geraldes

 

View solution in original post

1 REPLY 1
goncalogeraldes
Super User
Super User

Hello there @Anonymous ! Maybe this can work:

NetSales YoY% =
VAR CY = [Overall NS]

VAR PY = Calculate([Overall NS],PARALLELPERIOD(Calendar[Date], -2, YEAR))

Return
Divde (CY - PY, PY,0)

 

Hope this answer solves your problem! If you need any additional help please tag me in your reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️ or give it a kudoe 👍
Thanks!

Best regards,
Gonçalo Geraldes

 

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.