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
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
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.