Forum Discussion
Dynamically set slicers Value
- Anonymous5 years ago
Hi Anonymous ,
I created a sample pbix file for you, please check whether that is what you want.
1. Connect to the excel file
2. Create a custom column in Power Query Editor
let Source = Excel.Workbook(File.Contents("D:\data\sales.xlsx"), null, true), Table1_Table = Source{[Item="Table1",Kind="Table"]}[Data], #"Added Custom" = Table.AddColumn(Table1_Table, "Custom", each if [Year]=List.Max(Table1_Table[Year]) then "Default" else [Year]) in #"Added Custom"3. Create a slicer with new custom column and select the option "Default"
Best Regards
"Whether your report exist the data from year 2021 -YES?
And how does 2021 input by the user- "User Run SP and sp updated this flag in the YearTable"
Hi I uploaded snaphot of "Current Status" Vs Expected Status - Again i tell you the scenario -
I saved my report with Current Year 2020 since the flag value is 1 for this year - now in Jan-2021 sp run and update this "Flag" value to 1 -- I want my report to be open dynamically in 2021 based in Flag value is now 1 - however at the momvemt if i open the report it displays the value 2021 but bydefault opens in 2020 and then manully i have to change the Year value in slicer , and again upload the report to server , so that next time it open in 2021 .... I want this to dyncmiaclly open in 2021.
If you provide me your id i can send you sample file as well.
Hi Anonymous ,
I created a sample pbix file for you, please check whether that is what you want.
1. Connect to the excel file
2. Create a custom column in Power Query Editor
let
Source = Excel.Workbook(File.Contents("D:\data\sales.xlsx"), null, true),
Table1_Table = Source{[Item="Table1",Kind="Table"]}[Data],
#"Added Custom" = Table.AddColumn(Table1_Table, "Custom", each if [Year]=List.Max(Table1_Table[Year]) then "Default" else [Year])
in
#"Added Custom"
3. Create a slicer with new custom column and select the option "Default"
Best Regards