Forum Discussion
Dynamic date period
- 3 years ago
Hi,
Create a Calendar Table and write these calculated column formulas
Month name = format(calendar[Date],"mmmm")
Month number = month(calendar[date])
Appraisal year = if(calendar[month number]<=6,year(calendar[date])-1&" "&year(calendar[date]),year(calendar[date])&" "&year(calendar[date])+1)
Hope this helps.
Anonymous ,
Do you have that date anywhere in your data model?
Thanks,
Arul
No I dont. i Just know that is when appraisals for the year start
- Arul3 years agoSuper User
Anonymous ,
So, you don't want to change it everytime in the measure in PBI but you want the date needs to be changed dynamically.
Thanks,
Arul
- Anonymous3 years agoNot applicable
Yes. I want the date changed dynamically for every year of appraisal. If possible, i'd like to have a date filter for each appraisal year.
- Arul3 years agoSuper User
Anonymous ,
Create a parameter like this in Power query editor for dates.
Enable the data load option for parameter query in power query editor.
Then, write the below measure by changing the appropriate value based on your requirement.Color count = VAR _parameter = SELECTEDVALUE('Date Parameter'[Date Parameter]) VAR _result = CALCULATE( COUNT('Table'[Color]), 'Table'[Date] = _parameter) RETURN _resultUse parameter value wherever inside the measures to make it dynamically change(Please refer the pbix file to see how I have used date parameter value inside the measures).
To change the parameter value, you have to open edit parameters under transform data.
Then change the date values there,Please refer the attached pbix file.
Thanks,
Arul