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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

while calculate last week sale first week shows blank

Hi All,

 

While calculating Week over Week change the first-week record is blank, I trying

 

Sales WOW =
VAR ThisWeek = MAX(Sales[Week])
 
RETURN
CALCULATE(SUM(Sales[Price]),Sales[Week] = ThisWeek -1)
 
for 2020 first Week it needs to fetch the record of last week of 2019 and so on.
 
Thank You

 

3 REPLIES 3
Anonymous
Not applicable

Please do yourself a favor and follow the rules of correct dimensional modeling. You should first of all have a proper Date table in your model and secondly slice only by dimensions, never directly on your fact table's columns.

Then and only then will you be able to build correct calculations. Dealing with weeks is a tricky issue. Please follow this link:

https://www.sqlbi.com/articles/week-based-time-intelligence-in-dax/

Best
D
az38
Community Champion
Community Champion

@Anonymous 

do you have a column with Year?


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Yes, Year column is available in my table

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors