Forum Discussion
Showing visual in different timezone based on slicer selection or RLS
- 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.
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.
Hi v-chenwuz-msft,
When a date slicer was added to filter the data (considering more data are added in the future). the table and chart doesn't show correctly anymore.
A relationship between the Calendar[Date] and UTC[Start date UTC] is breaking the table/chart too
https://drive.google.com/file/d/1eRFOdOpQRkWKrB2EX26IvRwpkO5bgV69/view?usp=sharing
Your advice would be much appreciated
Thank you