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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.