Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I need to create a calculated column for dynamic time zone conversion when a specific time zone is created.
There is a table with time zone and time difference from UTC.
I have a table of orders as below, with order_id, original dates of orders.
time_diff is a measure:
time_diff = IF(
ISFILTERED('Time Zones'[Time Zone]),
TIME(DISTINCT('Time Zones'[Time Diff from UTC]), 0, 0)
)
date_converted is a calculated column
date_converted = FORMAT('orders'[date_original]+[time_diff], "General Date")
This is the expected results
order_id | date_original | time_diff | date_converted |
1 | 2020/10/11 2:00 AM | 08:00:00 | 2020/10/11 10:00 AM |
2 | 2020/10/11 8:00 AM | 08:00:00 | 2020/10/11 4:00 PM |
3 | 2020/10/11 2:00 PM | 08:00:00 | 2020/10/11 10:00 PM |
4 | 2020/10/11 8:00 PM | 08:00:00 | 2020/10/12 4:00 AM |
5 | 2020/10/12 2:00 AM | 08:00:00 | 2020/10/12 10:00 AM |
6 | 2020/10/12 8:00 AM | 08:00:00 | 2020/10/12 4:00 PM |
7 | 2020/10/12 2:00 PM | 08:00:00 | 2020/10/12 10:00 PM |
8 | 2020/10/12 8:00 PM | 08:00:00 | 2020/10/13 4:00 AM |
9 | 2020/10/13 2:00 AM | 08:00:00 | 2020/10/13 10:00 AM |
10 | 2020/10/13 8:00 AM | 08:00:00 | 2020/10/13 4:00 PM |
11 | 2020/10/13 2:00 PM | 08:00:00 | 2020/10/13 10:00 PM |
12 | 2020/10/11 2:00 AM | 08:00:00 | 2020/10/11 10:00 AM |
13 | 2020/10/11 8:00 AM | 08:00:00 | 2020/10/11 4:00 PM |
However, the date converted didn't change at all! What could be the problem?
Solved! Go to Solution.
Hi @evolve_Tricia ,
If you want dynamic, you need to change the calculate column to measure.
Please refer this measure.
date_converted = FORMAT(MAX(orders[date_original])+[time_diff], "General Date")
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
Hi @evolve_Tricia ,
If you want dynamic, you need to change the calculate column to measure.
Please refer this measure.
date_converted = FORMAT(MAX(orders[date_original])+[time_diff], "General Date")
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
Calculated Column <> Dynamic
A calculated column is a static value. You will want to use a measure instead, or rethink your logic.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |