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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.