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
AmberM
Helper II
Helper II

Same Period Last Year for Fiscal Week Nbr

I am trying to create a expression to compare sameperiodlastyear at a fiscal week level.

 

The calculation I tried (below) does not return the correct value.

Total Sales LY = CALCULATE( [Total Sales], SAMEPERIODLASTYEAR( Dates[Date] ) )

 

My data is at a fiscal week level, not at a date level.

For example, I need to compare Fiscal Week 201701 to Fiscal Week 201601, but the fiscal week begins in March. I haven't been able to find a solution that seems to work. Help!

 

1 ACCEPTED SOLUTION
AmberM
Helper II
Helper II

Here is the calculation thanks to Enterprise DNA, but it doesn't produce totals for a table, just by week number in the table.

 

https://www.youtube.com/watch?v=aODroF37pq0

 

Previous Year Sales = 
VAR CurrentWeek = SELECTEDVALUE( Dates[Week Number] )
VAR CurrentYear = SELECTEDVALUE( Dates[Year] )

RETURN
CALCULATE( [Total Sales],
    FILTER( ALL( Dates ),
		Dates[Week Number] = CurrentWeek && Dates[Year] = CurrentYear - 1))

View solution in original post

2 REPLIES 2
AmberM
Helper II
Helper II

Here is the calculation thanks to Enterprise DNA, but it doesn't produce totals for a table, just by week number in the table.

 

https://www.youtube.com/watch?v=aODroF37pq0

 

Previous Year Sales = 
VAR CurrentWeek = SELECTEDVALUE( Dates[Week Number] )
VAR CurrentYear = SELECTEDVALUE( Dates[Year] )

RETURN
CALCULATE( [Total Sales],
    FILTER( ALL( Dates ),
		Dates[Week Number] = CurrentWeek && Dates[Year] = CurrentYear - 1))
v-xjiin-msft
Solution Sage
Solution Sage

Hi @AmberM,

 

In your scenario, to custom Fiscal Week. I think you can refer to this relevant thread:

 

https://community.powerbi.com/t5/Desktop/Custom-Fiscal-Year-Calendar/td-p/85228 

 

Thanks,
Xi Jin.

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.