cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Tuan Regular Visitor
Regular Visitor

Calculate Fiscal Sales Last Year with subtotals

I'm trying to calculate last year sales on a Fiscal Calendar from the weeks level up to the quarter level. 

 

I used this code for Previous Year Sales. My problem is that I don't get the Subtotals for Monthly and Quarterly. My calendar itself does have a unique code that gives me year and week such as 20191 for 2019 week 1.

Previous Year Sales = 
VAR CurrentWeek = SELECTEDVALUE( VW_ROSSDW_DIM_DATE[fin_week_in_year] )
VAR CurrentYear = SELECTEDVALUE( VW_ROSSDW_DIM_DATE[fin_year])

RETURN
CALCULATE( [Demand $],
    FILTER( all(VW_ROSSDW_DIM_DATE),
		 VW_ROSSDW_DIM_DATE[fin_week_in_year]= CurrentWeek && VW_ROSSDW_DIM_DATE[fin_year] = CurrentYear - 1))

Sales.PNG

2 REPLIES 2
Community Support Team
Community Support Team

Re: Calculate Fiscal Sales Last Year with subtotals

@Tuan 

 

You may take a look at the posts below.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Tuan Regular Visitor
Regular Visitor

Re: Calculate Fiscal Sales Last Year with subtotals

That doesn't really solve my problem. I do have a Year/Week column in my date Dimension that says 201901, 201902, etc.

 

Been trying to get this code to work. The minus 100 is to offset the year to 201801, 201802, etc. It not working.

 

VAR CurrentWeek = SELECTEDVALUE( VW_ROSSDW_DIM_DATE[fin_week_in_year] )
VAR CurrentYear = SELECTEDVALUE( VW_ROSSDW_DIM_DATE[fin_year])

RETURN
CALCULATE( [Demand $],
    FILTER( VW_ROSSDW_DIM_DATE,
		 VW_ROSSDW_DIM_DATE[fin_year_week]-100))

Helpful resources

Announcements
Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 414 members 4,177 guests
Please welcome our newest community members: