Forum Discussion
line graph including time difference as y axis
Hi sclencioco,
If I understand correctly, you need to show the values of column [time diff] on Y-axis, grouped on date column which is added on X-axis, right?
Actually, it is not possible to achieve that. Because Y-axis only supports numeric values. If you add time value or text value, it will show Count/Count(distinct) value by default. In your scenario, you could convert your time diff to seconds or hours, then add it to Y-axis.
Regards,
Yuliana Gu
Hi v-yulgu-msft,
So I need to split start_on and end_on to get the date and time to be used on line graph?
- v-yulgu-msft9 years ago
Microsoft Employee
Hi sclencioco,
I noticed that there is a column named as [time diff] in source table, you could convert its values from HH:MM:SS to integer (seconds/hours/minutes).
To add date values on X-axis, you could extract the date part from date/time first.
Regards,
Yuliana Gu- sclencioco9 years ago
Helper I
Hi v-yulgu-msft,
I created [time diff] as MEASUREMENT. How can I make it an integer? Using Data type will do?
Thank you.
Saldie
- v-yulgu-msft9 years ago
Microsoft Employee
Hi sclencioco,
Not sure how you created the measure for [time diff]. But you could try this to calculate the time difference in hours/minutes/seconds.
Hour diff = DATEDIFF(MAX(Table_name[START_ON]),MAX(Table_name[END_ON]),HOUR)
Minute diff = DATEDIFF(TMAX(able_name[START_ON]),MAX(Table_name[END_ON]),MINUTE)
Second diff = DATEDIFF(MAX(Table_name[START_ON]),MAX(Table_name[END_ON]),SECOND)
Regards,
Yuliana Gu