Forum Discussion

WHENG's avatar
WHENG
Frequent Visitor
4 years ago
Solved

Showing visual in different timezone based on slicer selection or RLS

I have an Events table with the following columns Event ID Start date (Data in UTC format) Title Status Category A timezone table with the following column Timezone Is there a way that i ...
  • v-chenwuz-msft's avatar
    4 years ago

    Hi WHENG ,

     

    This code to change the bar chart.

    Bar chart =
    VAR _datetime =
        SWITCH(
            SELECTEDVALUE( Timezone[Timezone] ),
            "Asia/Singapore", TIME( 8, 0, 0 ),
            "Asia/Bangkok", TIME( 7, 0, 0 ),
            0
        )
    RETURN
        COUNTROWS(
            FILTER(
                UTC,
                DATE( YEAR( [Start date UTC] + _datetime ), MONTH( [Start date UTC] + _datetime ), DAY( [Start date UTC] + _datetime ) )
                    >= MIN( 'Calendar'[Date] )
                    && DATE( YEAR( [Start date UTC] + _datetime ), MONTH( [Start date UTC] + _datetime ), DAY( [Start date UTC] + _datetime ) )
                        <= MAX( 'Calendar'[Date] )
            )
        )
    

    Result:

    Pbix in the end you can refer.

    Best Regards

    Community Support Team _ chenwu zhu

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.