Forum Discussion

cutestjigs's avatar
cutestjigs
Frequent Visitor
8 years ago
Solved

Display data by selected date type

  Hi there,   I want to display data in different time zone based on which time zone is selected by the user. If user select China time zone, then data should display in china time zone.    For ...
  • Seward12533's avatar
    8 years ago
    One way is to forget your extra columns. You need to use a disconnected slicer (table not linked to other tables in your model with the list of time zones and offsets from UTC. Then harvest the selected value using SELECTEDVALUE

    OFFSET = SELECTEDVALUE(timezones[Offset],0)

    DisplayDateTime= average(table[invoicedatetimeutc)+TIME(offset)

    Or if you want the 3 columns your time zone table just needs to have the time zone names.

    TIMEZONE=SELECTEDVALUE(timezones[zone],”UTC”) // selects or default to utc

    Display Time = SWITCH(TRUE(),
    “China”, average(table[invoivedatetimechina],
    “NZ”, average(table[incoicedatetimenz],
    average(table[incoicedatetimeutc])

    And then use Display Time in your visual.


  • Seward12533's avatar
    Seward12533
    8 years ago
    Did you create a separate table with only a list of time zones in it or are you trying to slice from a column in your table? Please check that you are using a slider visual not a table. Can you share a workbook that demonstrates this behavior? All you need is your slicer table and selected timezoe measure and a card visual to display selected time zone.