Dynamically select the latest month from the slicer

preview_player
Показать описание
In the past I would have said no to being able to select the latest or current month from a slicer dynamically. I would have created a calculated column that indicated a specific month as the current one and shown "current month" in the slicer instead of the actual period.

And then I stumbled upon a blog post by fellow Fabric community superuser Owen Auger. In his blog, he discussed several methods to address this scenario, but what stood out is what's shown in the video.

The method leverages the Group by Columns property to "store a filter by using an alternate value, which represents the key of the entity." Power BI uses this key to store the filter, allowing the corresponding filter value in the visual to change dynamically. For instance, if May-24 is selected in the visual and currently has a key of 0, when June arrives, May will shift to a key of 1, and June will take the key of 0. Consequently, the slicer selection will automatically change to June.

#powerbi #slicer
Рекомендации по теме
visit shbcf.ru