Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi, I am working on a calendar for events that defaults to ET. Users would like to be able to switch to different timezones eg GMT and SGT.
I have no problem adding the new timezones as different columns but I know switching out fields from the visual will not persist across bookmarks.
Anyone have a way of explaining how field parameters could help? I;ve qatched a few videos on it but amn't quite able to apply to my own report as I haven't found with with a date use case.
Edited to add sample data and query.
Unable to share a sample file - here is some of what the data looks like and a santised query:
let
Source = Excel.Workbook(File.Contents("H:\Calendar Export 081922.xlsx"), null, true),
#"Grid Results_Sheet" = Source{[Item="Grid Results",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(#"Grid Results_Sheet", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"news_id", Int64.Type}, {"start_time", type datetime}, {"end_time", type datetime}, {"type", type text}, {"inactive_from_time", type datetime}, {"visibility_ind", type text}, {"modified_time", type datetime}}),
#"Added Conditional Column" = Table.AddColumn(#"Changed Type", "Type", each if [type] = "A" then "Announcement" else if [type] = "L" then "Limitation" else if [type] = "H" then "Holiday" else if [type] = "E" then "Event" else null),
#"Added Custom1" = Table.AddColumn(#"Added Conditional Column", "ET S Time", each [start_time]-#duration(0,5,0,0)),
Custom1 = Table.AddColumn(#"Added Custom1", "GMT S Time", each [start_time]-#duration(0,10,0,0)),
Custom2 = Table.AddColumn(Custom1, "GMT E Time", each [end_time]-#duration(0,10,0,0)),
Custom3 = Table.AddColumn(Custom2, "SGT E Time", each [end_time]-#duration(0,19,0,0)),
Custom4 = Table.AddColumn(Custom3, "SGT S Time", each [start_time]-#duration(0,19,0,0)),
#"Changed Type2" = Table.TransformColumnTypes(Custom4,{{"ET S Time", type datetime}}),
#"Added Custom2" = Table.AddColumn(#"Changed Type2", "ET E Time", each [end_time]-#duration(0,5,0,0)),
#"Changed Type3" = Table.TransformColumnTypes(#"Added Custom2",{{"ET E Time", type datetime}, {"SGT S Time", type datetime}, {"SGT E Time", type datetime}, {"GMT E Time", type datetime}, {"GMT S Time", type datetime}}),
#"Reordered Columns" = Table.ReorderColumns(#"Changed Type3",{"ET S Time", "ET E Time", "GMT S Time", "GMT E Time", "SGT E Time", "SGT S Time"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Reordered Columns",{{"news_id", type text}})
in
#"Changed Type1"
Only start time and end time are really relevant for what we are trying to do - switch from ET (which is produced in power query) to GMT or SGT using buttons or a slicer (pretty much the same difference)
| news_id | start_time | end_time | type | inactive_from_time | visibility_ind | modified_time |
| 130327 | 1/1/2021 5:00:00 AM | 2/1/2023 5:00:00 AM | A | 2/1/2023 5:00:00 AM | Y | 6/10/2022 10:13:35 AM |
| 119212 | 1/1/2021 5:00:00 AM | 2/1/2023 5:00:00 AM | A | 2/1/2023 5:00:00 AM | Y | 5/23/2022 9:26:56 PM |
| 271 | 1/1/2021 5:00:00 AM | 1/3/2024 4:45:00 AM | A | 1/3/2024 4:45:00 AM | Y | 3/7/2022 6:43:59 PM |
| 135777 | 8/19/2022 10:00:00 PM | 8/20/2022 10:00:00 PM | H | 8/20/2022 10:00:00 PM | Y | 12/24/2021 4:55:57 PM |
| 135989 | 8/20/2022 4:00:00 AM | 8/20/2022 7:00:00 PM | L | 8/20/2022 7:00:00 PM | Y | 8/11/2022 5:00:32 AM |
| 135886 | 8/20/2022 11:00:00 AM | 8/20/2022 5:00:00 PM | L | 8/20/2022 5:00:00 PM | Y | 8/3/2022 4:58:20 PM |
| 135996 | 8/20/2022 5:00:00 PM | 8/20/2022 10:00:00 PM | L | 8/20/2022 10:00:00 PM | Y | 7/29/2022 4:24:46 AM |
| 135712 | 8/26/2022 4:00:00 AM | 9/2/2022 4:00:00 AM | L | 9/2/2022 4:00:00 AM | Y | 8/17/2022 1:48:49 PM |
| 135875 | 8/27/2022 1:00:00 AM | 8/29/2022 1:00:00 AM | L | 8/29/2022 1:00:00 AM | Y | 5/12/2022 2:05:59 PM |
| 135990 | 8/27/2022 4:00:00 AM | 8/27/2022 7:00:00 PM | L | 8/27/2022 7:00:00 PM | Y | 7/12/2022 9:41:11 PM |
| 135923 | 8/27/2022 4:00:00 AM | 8/29/2022 4:00:00 AM | E | 8/29/2022 4:00:00 AM | Y | 4/19/2022 3:45:02 PM |
| 136012 | 8/27/2022 12:00:00 PM | 8/27/2022 4:30:00 PM | L | 8/27/2022 4:30:00 PM | N | 8/17/2022 2:12:25 PM |
| 135769 | 8/29/2022 4:00:00 AM | 8/30/2022 4:00:00 AM | H | 8/30/2022 4:00:00 AM | Y | 12/24/2021 11:46:10 AM |
| 135803 | 8/30/2022 6:30:00 PM | 8/31/2022 6:30:00 PM | H | 8/31/2022 6:30:00 PM | Y | 12/30/2021 7:38:45 AM |
| 135952 | 9/2/2022 10:00:00 PM | 9/4/2022 8:00:00 PM | L | 9/4/2022 8:00:00 PM | Y | 5/12/2022 2:05:35 PM |
| 136013 | 9/3/2022 3:00:00 AM | 9/3/2022 6:00:00 AM | L | 9/3/2022 6:00:00 AM | Y | 8/18/2022 4:11:17 PM |
Hi @E_K_ ,
How about use a slicer?
Create a table column with GMT and SGT. Like the following:
| column1 |
| GMT |
| SGT |
Then put the column1 into the slicer.
Then unpivot the GMT and SGT columns in table_time. Like the following:
| subject | time |
| GMT | 2020/12/21 10:19:20 |
| SGT | 2020/12/21 02:19:20 |
Then create a measure in the table_time.
measure =
VAR _1 =
SELECTEDVALUE ( 'table'[column1] )
RETURN
IF ( _1 = MAX ( table_time[subject] ), MAX ( table_time[time] ), BLANK () )
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Unfortunately this does not work as I am working with start and end times and was to avoid merging columns to ensure by report actually loads! This means that when transponsing, with my full dataset, I end up with over 200 columns in the calculated table (am assuming you meant to use power query, which is what I tried.
Unable to share a sample file - here is some of what the data looks like and a santised query:
let
Source = Excel.Workbook(File.Contents("H:\Calendar Export 081922.xlsx"), null, true),
#"Grid Results_Sheet" = Source{[Item="Grid Results",Kind="Sheet"]}[Data],
#"Promoted Headers" = Table.PromoteHeaders(#"Grid Results_Sheet", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"news_id", Int64.Type}, {"start_time", type datetime}, {"end_time", type datetime}, {"type", type text}, {"inactive_from_time", type datetime}, {"visibility_ind", type text}, {"modified_time", type datetime}}),
#"Added Conditional Column" = Table.AddColumn(#"Changed Type", "Type", each if [type] = "A" then "Announcement" else if [type] = "L" then "Limitation" else if [type] = "H" then "Holiday" else if [type] = "E" then "Event" else null),
#"Added Custom1" = Table.AddColumn(#"Added Conditional Column", "ET S Time", each [start_time]-#duration(0,5,0,0)),
Custom1 = Table.AddColumn(#"Added Custom1", "GMT S Time", each [start_time]-#duration(0,10,0,0)),
Custom2 = Table.AddColumn(Custom1, "GMT E Time", each [end_time]-#duration(0,10,0,0)),
Custom3 = Table.AddColumn(Custom2, "SGT E Time", each [end_time]-#duration(0,19,0,0)),
Custom4 = Table.AddColumn(Custom3, "SGT S Time", each [start_time]-#duration(0,19,0,0)),
#"Changed Type2" = Table.TransformColumnTypes(Custom4,{{"ET S Time", type datetime}}),
#"Added Custom2" = Table.AddColumn(#"Changed Type2", "ET E Time", each [end_time]-#duration(0,5,0,0)),
#"Changed Type3" = Table.TransformColumnTypes(#"Added Custom2",{{"ET E Time", type datetime}, {"SGT S Time", type datetime}, {"SGT E Time", type datetime}, {"GMT E Time", type datetime}, {"GMT S Time", type datetime}}),
#"Reordered Columns" = Table.ReorderColumns(#"Changed Type3",{"ET S Time", "ET E Time", "GMT S Time", "GMT E Time", "SGT E Time", "SGT S Time"}),
#"Changed Type1" = Table.TransformColumnTypes(#"Reordered Columns",{{"news_id", type text}})
in
#"Changed Type1"
Only start time and end time are really relevant for what we are trying to do - switch from ET (which is produced in power query) to GMT or SGT using buttons or a slicer (pretty much the same difference)
| news_id | start_time | end_time | type | inactive_from_time | visibility_ind | modified_time |
| 130327 | 1/1/2021 5:00:00 AM | 2/1/2023 5:00:00 AM | A | 2/1/2023 5:00:00 AM | Y | 6/10/2022 10:13:35 AM |
| 119212 | 1/1/2021 5:00:00 AM | 2/1/2023 5:00:00 AM | A | 2/1/2023 5:00:00 AM | Y | 5/23/2022 9:26:56 PM |
| 271 | 1/1/2021 5:00:00 AM | 1/3/2024 4:45:00 AM | A | 1/3/2024 4:45:00 AM | Y | 3/7/2022 6:43:59 PM |
| 135777 | 8/19/2022 10:00:00 PM | 8/20/2022 10:00:00 PM | H | 8/20/2022 10:00:00 PM | Y | 12/24/2021 4:55:57 PM |
| 135989 | 8/20/2022 4:00:00 AM | 8/20/2022 7:00:00 PM | L | 8/20/2022 7:00:00 PM | Y | 8/11/2022 5:00:32 AM |
| 135886 | 8/20/2022 11:00:00 AM | 8/20/2022 5:00:00 PM | L | 8/20/2022 5:00:00 PM | Y | 8/3/2022 4:58:20 PM |
| 135996 | 8/20/2022 5:00:00 PM | 8/20/2022 10:00:00 PM | L | 8/20/2022 10:00:00 PM | Y | 7/29/2022 4:24:46 AM |
| 135712 | 8/26/2022 4:00:00 AM | 9/2/2022 4:00:00 AM | L | 9/2/2022 4:00:00 AM | Y | 8/17/2022 1:48:49 PM |
| 135875 | 8/27/2022 1:00:00 AM | 8/29/2022 1:00:00 AM | L | 8/29/2022 1:00:00 AM | Y | 5/12/2022 2:05:59 PM |
| 135990 | 8/27/2022 4:00:00 AM | 8/27/2022 7:00:00 PM | L | 8/27/2022 7:00:00 PM | Y | 7/12/2022 9:41:11 PM |
| 135923 | 8/27/2022 4:00:00 AM | 8/29/2022 4:00:00 AM | E | 8/29/2022 4:00:00 AM | Y | 4/19/2022 3:45:02 PM |
| 136012 | 8/27/2022 12:00:00 PM | 8/27/2022 4:30:00 PM | L | 8/27/2022 4:30:00 PM | N | 8/17/2022 2:12:25 PM |
| 135769 | 8/29/2022 4:00:00 AM | 8/30/2022 4:00:00 AM | H | 8/30/2022 4:00:00 AM | Y | 12/24/2021 11:46:10 AM |
| 135803 | 8/30/2022 6:30:00 PM | 8/31/2022 6:30:00 PM | H | 8/31/2022 6:30:00 PM | Y | 12/30/2021 7:38:45 AM |
| 135952 | 9/2/2022 10:00:00 PM | 9/4/2022 8:00:00 PM | L | 9/4/2022 8:00:00 PM | Y | 5/12/2022 2:05:35 PM |
| 136013 | 9/3/2022 3:00:00 AM | 9/3/2022 6:00:00 AM | L | 9/3/2022 6:00:00 AM | Y | 8/18/2022 4:11:17 PM |
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.