Forum Discussion
Default Selection for Latest Period (Data for Latest Period)
- 5 years ago
Anonymous thanks for your help.
I don't want to use the static dates; the dates should be dynamic, in measures calculation.I tried to overcome the filtering at each visual as well.Finally got some solution, after tweaking my initial DAX measure. Here is the DAX measure calculation I used to achieve this..SalesAmount Latest Period=Var _MaxReportPeriod =CALCULATE(MAX(Sales[ReportingPeriod]),ALLEXCEPT(Sales,Sales[ReportingPeriod],Sales[ReportingYear]))RETURNCALCULATE(SUM(Sales[Amount]), Sales[ReportingPeriod] = _MaxReportPeriod)
pradeept , You have to create columns like these on you date Table
Month Type = Switch( True(),
eomonth([Date],0)= eomonth(Today(),0),"Current Month" ,
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
Format([Date],"MMM-YYYY")
)
Year Type = Switch( True(),
year([Date])= year(Today()),"This Year" ,
Format([Date],"YYYY")
)
Select This Year and current month
refer my video
amitchandak thanks for you suggestion. but this is not what I am looking for exactly.
Step-1:
When we open the page/dashboard, by default Year/Month should be filtered automatically for "This Year" and "This Month" . There should not be any manual process for selections. (labels should be '2021', '202103')
Step-2:
After analysing the charts/reports for latest period, if any further analysis required then we will select the necessary time periods.
Thanks, pradeep