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
ren_steffen
Frequent Visitor

YTD sales per week by Reseller using ISO Week Number

I am trying to calculate YTD sales per week for each reseller based on ISO WeekNumber. I have tried various measures and calculated columns such as

YTDTest1 =

CALCULATE(
SUM( ResellerSales[NetSales] ),
FILTER(
ALL(
ResellerSales
),
ResellerSales[WeekNumberISO] = ResellerSales[WeekNumberISO]-1

)
)

Is this possible get YTD updated for each WeekNumber per Reseller?

I chose not to use a date field because based on week number. Would consider creating a Date Dimension if that will make this easier.

My data looks like this

ResellerIdWeekNumber ISOWeekNumber Year ISONetSalesCalc Reseller YTDCalc NetSales Weekly Rank
1502019 $             392.01  
1512019 $             681.38  
1522019 $             350.47  
112020 $             141.55  
122020 $             764.44  
132020 $               85.25  
22502019 $             767.09  
22512019 $             495.98  
22522019 $             872.44  
2212020 $             630.64  
2222020 $             309.46  
2232020 $               62.06  
34502019 $             269.23  
34512019 $             151.98  
34522019 $               23.16  
3412020 $             762.61  
3422020 $             771.34  
3432020 $             473.44  

 

2 REPLIES 2
Greg_Deckler
Super User
Super User

@ren_steffen Seems like you need to add YEAR filter into your calculation, otherwise you will get weeks in previous years.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

With the current CALCULATE and FILTER there is no data returning. Same with adding a YEAR to the filter, and also adding a filter for store.  If I filter to a SELECTEDVALUE( WeekNumber Field), with YEAR, it sums the same number for all years all records.

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.