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
jawilson808
Helper I
Helper I

Last Week Sales with Date Hierachy

Hi all!

 

I am looking for some assistance with the Dateadd Dax. I have two data points I am trying to show by date, current week sales and last week's sales. Creating a dax for last week's sales is not an issue by using calculate(sales,dateadd(date,-7,day)). When doing so I get the correct value, however, when adding it to a matrix that has a date hierarchy, last week's sales only provide a total, whereas I would like to see each daily amount. If I do not use the date hierachy and use date instead, the day by day total shows for last week with the correct amounts. Below is what is returned.

 

Undesired display using a date hierarchy. However, last week total is correct.

jawilson808_0-1648150992302.png

Without date hierarchy. Day-by-day total shows as desired. 

jawilson808_1-1648151104521.png

How can I achieve the same result by using the date hierarchy?

 

 

 

2 REPLIES 2
v-rongtiep-msft
Community Support
Community Support

Hi @jawilson808 , 

I cannot reproduce your issue.

vpollymsft_0-1648545465602.png

It may some errors on your DAX. If you are using selectedvalue, please modify the formula.

 

Could you please provide your pbix file without privacy information and the dax formula?

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

VahidDM
Super User
Super User

Hi @jawilson808 

 

Chek this link, it might be useful:

 

https://www.vahiddm.com/post/weekly-time-intelligence-dax

 

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

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.

Top Solution Authors