The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I wanted to be pre-selected dynamically on the basis of the current year
Thanks !!
Hi @poweryogesh ,
According to your description, here's my solution.
1.In Power Query, right click the Year column, select Change Type>Date.
2.Change the Format to 2001(yyyy).
3.Click the expand button in the upper right corner of the slicer, select "Relative Date".
4.Then select This Year, it will always show the current year.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for the solution @v-yanjiang-msft .
However, I wanted this feature in a drop-down slicer as shown in my original post.
Year selection should be dynamically on the basis of today() function. and wanted to implement the same for the quarter slicer.
Thank you !!
@poweryogesh , As of you have to create a custom column with This year or last year and default that
Year Type = Switch( True(),
year([Date])= year(Today()),"This Year" ,
year([Date])= year(Today())-1,"Last Year" ,
Format([Date],"YYYY")
)
Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA
this option really nice for my scenario. i can even adding date hierachy to drill further. i have manage to change your solution to below so that am able to show year format for other year for easy reading.
Thanks
@amitchandak wrote:@poweryogesh, As of you have to create a custom column with This year or last year and default that
Year Type = Switch( True(),
year([Date])= year(Today()),"This Year" ,
year([Date])= year(Today())-1,"Last Year" ,
Format([Date],"YYYY")
)
Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA
@poweryogesh , I doubt any other way as of now.
There are a few ideas around, You can vote - https://ideas.powerbi.com/ideas/