Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have the following expressions:
Current Month to date
= sum({$<Month={"$(=Date(Max(Month),'MMM-YY'))"}>}[Sales])
Previous Month to date
= sum({$<Month={"$(=Date(addmonths(Max(Month),-1),'MMM-YY'))"}>}([Sales])
these 2 works fine but i want to add another field that could see less 3 days Current Month to date and less 3 days Previous Month to date. e.g. i select July 1 to 5 but it would only select July 3 to 5 only on the next two expressions.
My Script below:
LOAD
Day (Date) as DayDate,
Month( Date) as MonthDate,
Year (Date) as YearDate,
Date(Date,'MM-DD-YYYY') as Date,
Date(Date,'MMM-YY') as Month,
Sales,
Customers
;
SQL SELECT * FROM dbo.customers;
Thanks
What would you want to see when you select Jun 5th to Jun 15th? I am not completely sure I understand what your goal is?
Hi Sunny,
For example i select July 1 to 5 ( month to date) i can see these transaction details but also want to see together with the last 3 days July 3 to 5 (month to date).
the user wants to see last 3 days vs month to date transactions in their report.
Perhaps this?
Current MTD
= sum({$<DayDate={">=$(=Max(DayDate-2))<=$(=Max(DayDate))"}, Month={"$(=Date(addmonths(Max(Month),-1),'MMM-YY'))"}>}[Sales])
Previous MTD
= sum({$<Month={"$(=Date(addmonths(Max(Month),-1),'MMM-YY'))"}, DayDate={">=$(=Max(DayDate-2))<=$(=Max(DayDate))"}>}([Sales])
Here is a visual guide ![]()
Hi Anil,
it didnt work.
So, the user will never select Jun 5th to Jun 15th? or Jun 1st to Jun 15th? You are repeating the same example over and over... I am looking for understanding the requirement based on multiple different selections