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

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
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,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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