Forum Discussion
undefined
- 1 year ago
Hello Anonymous
You can use the dax for calculated column
LastDateLabel =
VAR LatestDate = CALCULATE(MAX('YourTable'[Date]), ALL('YourTable'))
RETURN
IF(
'YourTable'[Date] = LatestDate,
"Last Date",
RELATED('d_Calendario'[Date]) -- or FORMAT(RELATED(...), "yyyy-mm-dd") if you want a formatted text
)use this column to slicer keep last date selected in slicer
Thanks,
Pankaj Namekar | LinkedInIf this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.
Hi Anonymous
If you want the actual latest date to be selected by default—rather than using a label like "latest date"—you’ll need to use Tabular Editor. Specifically, you can use the *Group By Columns* property to store a filter based on an alternate value, which acts as the key for the entity. Power BI stores this key behind the scenes, allowing the visible filter value to update automatically.
For example, if May-24 is selected and has a key of 0, then when June arrives, June will take the key 0 and May will shift to 1. This causes the slicer to automatically reflect the most recent date without any manual change. If you're not comfortable using this method, you'll need to explore other alternatives provided.
Please refer to this video-https://www.youtube.com/watch?v=MrEAZREQuXM&ab_channel=DAXJutsu