Forum Discussion
WHENG
4 years agoFrequent Visitor
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 ...
- 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.
v-chenwuz-msft
Community Support
4 years agoHi 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.
WHENG
4 years agoFrequent Visitor
Hi v-chenwuz-msft,
Thanks a lot!