cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Weekly sales measure is not working correctly, looks like something is wrong with the relationship.

Hello,
My weekly sales measure looks like this:

RWT Sales (week):=CALCULATE([Sales],'Order Date'[Date] >= TODAY()-6,'Order Date'[Date]<=TODAY())

It works fine when im combining it with customer data, but i would like to show it pr day in a visual. But when i use my order date table it looks like this (in a table):

And it continues through 2040 (which is the size of my 'order date' table. What am i doing wrong?

 
 
 

1e835e3xbsn41.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Weekly sales measure is not working correctly, looks like something is wrong with the relationsh

Hi @KristianS , 

I think you need to add filter in expression like below

RWT Sales (week):=CALCULATE([Sales],filter('Order Date','Order Date'[Date] >= TODAY()-6 && 'Order Date'[Date]<=TODAY()))

If this doesn't work, please check whether your order date table have relationship between your fact table(or measure [Sales]). You could inform me your data structure and your relationship.

 

Best Regards,
Zoe Zhi

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

View solution in original post

4 REPLIES 4
Highlighted
Super User II
Super User II

Re: Weekly sales measure is not working correctly, looks like something is wrong with the relationsh

Hi @KristianS 

if you need running total day by day it is incorrect to compare dates with today() which is always the same for each row

try

RWT Sales (week):=CALCULATE([Sales],'Order Date'[Date] >= SELECTEDVALUE('Order Date'[Date]),'Order Date'[Date]<=SELECTEDVALUE('Order Date'[Date]))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Highlighted
Super User IV
Super User IV

Re: Weekly sales measure is not working correctly, looks like something is wrong with the relationsh

Try like


RWT Sales (week):=CALCULATE([Sales],filter('Order Date','Order Date'[Date] >= max('Order Date'[Date])-6 && 'Order Date'[Date]max('Order Date'[Date])))

with Date calendar
RWT Sales (week):=CALCULATE([Sales],filter('Date','Date'[Date] >= max('Date'[Date])-6 && 'Date'[Date]max('Date'[Date])))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Community Support
Community Support

Re: Weekly sales measure is not working correctly, looks like something is wrong with the relationsh

Hi @KristianS , 

I think you need to add filter in expression like below

RWT Sales (week):=CALCULATE([Sales],filter('Order Date','Order Date'[Date] >= TODAY()-6 && 'Order Date'[Date]<=TODAY()))

If this doesn't work, please check whether your order date table have relationship between your fact table(or measure [Sales]). You could inform me your data structure and your relationship.

 

Best Regards,
Zoe Zhi

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

View solution in original post

Highlighted
New Member

Re: Weekly sales measure is not working correctly, looks like something is wrong with the relationsh

Thanks a lot! Addig Filter worked.

What does that do? I thought the calculate function automaticly add filters.

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors