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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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