Forum Discussion
Last period Data based on Date/Quarter/Month/Week Filter selection
- 8 years ago
Its all about filter context, Try creating a lookupdate table with Just YEARMONTHSHORT values
YEARMONTHS = VALUES(date[YearMonthShort])
Relate that to your data table and set your slice on that.
If doesn't work, you could try NOT using a SLICER to select the month but instead use a disconnected slicer to have user select month, date or whatever and then use that SELECTEDVALUE of what the user selectes as teh desired period in your measures.
Its all about filter context, Try creating a lookupdate table with Just YEARMONTHSHORT values
YEARMONTHS = VALUES(date[YearMonthShort])
Relate that to your data table and set your slice on that.
If doesn't work, you could try NOT using a SLICER to select the month but instead use a disconnected slicer to have user select month, date or whatever and then use that SELECTEDVALUE of what the user selectes as teh desired period in your measures.
Hi Seward12533,
First of all Thanks for spending time to explain me.
I tried the above things which you mentioned. I couldn't do the 1st option as my data model didn't allow me to create link between 'DateDim' table and 'Filter Table' which you mentioned to create lookup Table as it gave me error cannot create the relationship as it has null data.
I tried the 2nd option, created disconnected table 'Filter_Table' using the below formula:
OIF_Value_EUR_Calc = VAR LstDate = MAX (Filter_Table[Date]) RETURN
CALCULATE (
SUM ( V_OPPORTUNITIES_OIF[OIF_Value_EUR] ),Filter_Table[Date],
FILTER(ALL(DateDIM) , DateDIM[date]<=LstDate&&DateDIM[date]<=LstDate-3))
But I am not getting one thing. For the disconnected silicer, how I would get relative 'OIF_EUR_Value_Calc' value. I tried using 'SelectedValues' but it didn't work. Am i doing anything wrong here?
Thanks!
- Poonam
- Anonymous8 years agoNot applicable
Hi Seward12533,
It is working now. I changed my formula as below:
OIF_Value_EUR_Calc = VAR LstDate = (max(Filter_Table[Date])) Return
CALCULATE (
SUM ( V_OPPORTUNITIES_OIF[OIF_Value_EUR] ),
DateDIM[Date]<=LstDate&&DateDIM[Date]>=LstDate-365)Thanks a lot for all your help! :)
Regards,
Poonam
- Seward125338 years ago
Solution Sage
If its a good date table then there should not be blanks :) But I'm glad it worked! BTW if you ever wanted to try the option I suggested for creating the bidge table dynamically with DAX
NTHS = CALCULATE(VALUES(date[YearMonthShort]),NOT(ISBLANK(date(YearMonthyShort)))