Display Last Weeks Data Dynamically Based On Date selection in slicer

Aradhika

New Member
Joined
Jul 20, 2019
Messages
11
Hi Team,

I have requirement in my project such as if i select "OrderDate"
From Slicer then based on that date last week sales data should populate in visual.
Example:
Suppose:
If i select 4/12/2020 in slicer then last week data should populate from that date.
If i select 11/22/2019 in slicer then last week data should populate from that date.

Columns i have is Order_date, Sales - Only two columns i am using...

I've created a couple of DAX Measures. However, that measure is calculating all weeks inspite of 1 Week.

Thanks for any help you can provide. You've been great.
AD
 
Hi Aradhika,

To retrieve the total in a single card you can use this adjusted version:

Rich (BB code):
mSumOrders = 
    var SelectedDate = SELECTEDVALUE(Orders[OrderNewDate])
    var NewDate = DATEADD(Orders[OrderNewDate], -3, MONTH)
return
    CALCULATE(
        SUM(Orders[Sales]),
        FILTER(ALL(Orders[OrderNewDate]), 
            Orders[OrderNewDate] < SelectedDate &&
            Orders[OrderNewDate] >= NewDate)
    )

Let me know if that works for you.
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi Aradhika,

To retrieve the total in a single card you can use this adjusted version:

Rich (BB code):
mSumOrders =
    var SelectedDate = SELECTEDVALUE(Orders[OrderNewDate])
    var NewDate = DATEADD(Orders[OrderNewDate], -3, MONTH)
return
    CALCULATE(
        SUM(Orders[Sales]),
        FILTER(ALL(Orders[OrderNewDate]),
            Orders[OrderNewDate] < SelectedDate &&
            Orders[OrderNewDate] >= NewDate)
    )

Let me know if that works for you.
 
Upvote 0
Hi JustynaMK,

Sorry for delay in Reply.

It is working as expected... Again thank you for ur help and time... :)

Regards,
Aradhikar
 
Upvote 0

Forum statistics

Threads
1,223,792
Messages
6,174,613
Members
452,574
Latest member
hang_and_bang

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top