Forum Discussion
Keeping most recent value on slicers
- 10 years ago
Anonymous - I am wondering if igordossantos issue is similar to the issue with Dashboard tiles not refreshing when the year and month change and therefore have to be re-pinned. I believe that greggyb solved this in another thread. Basically, the idea was to create a column that had a flag if it was the current month and current year and then filter on that instead of the actual month and year.
Not sure if this is the problem and having a devil of a time finding that thread.
Found it:
The general rule in PBI is that slicer and filter selections cannot change without user input. If you're embedding in another application, you could certainly pass filter parameters that are updated by code in the hosting application.
Within Power BI, the only way to make "dynamic" slicer selections is to make sure your data changes in such a way that the literal value selected in the slicer represents the selection you want. Rather than dynamic slicers and static data (e.g. slicer updates to "2016 February"), we can have static slicers and dynamic data (e.g. slicer always set to "Current month", where data refresh process sets "Current Month" to apply only to February of 2016). Greg_Deckler has linked to a post describing how you can do this.
- SHHargrove10 years ago
Advocate II
We're having good luck adding a field to the Time Dimension named "DateLag" whose value is 0 for the current month and grows with each month of history. Then we filter our reports for DateLag=0.
Rather then writing DAX or MDX for this, we've found it easier to just do it in the ETL (either PowerQuery or SSIS).
This approach also makes it quite easy to do things like informing the user of what's different in the world this month from what he saw last month: i.e. YOY Change in YTD Sales for dateLag=0compared to YOY change in YTD sales for datelag=1.