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 have a table listing three columns as below for the fuel level in the tank on different times during the day.
Time | Status | Fuel Level* |
11:42:23 AM | Motion | 88.91 |
11:42:28 AM | Motion | 88.91 |
11:42:33 AM | Motion | 87.96 |
11:42:38 AM | Motion | 87.96 |
11:42:43 AM | Motion | 88.91 |
11:42:48 AM | Motion | 87.96 |
11:42:53 AM | Motion | 87.96 |
11:42:58 AM | Motion | 88.74 |
11:43:03 AM | Motion | 88.74 |
11:43:08 AM | Motion | 88.74 |
11:43:13 AM | Motion | 88.91 |
11:43:18 AM | Motion | 88.91 |
11:43:23 AM | Motion | 88.91 |
11:43:28 AM | Motion | 88.74 |
11:43:33 AM | Motion | 86.68 |
11:43:38 AM | Motion | 86.68 |
11:43:43 AM | Motion | 86.68 |
11:43:48 AM | Motion | 86.84 |
11:43:53 AM | Motion | 86.84 |
11:55:11 AM | Motion | 86.53 |
11:55:16 AM | Motion | 86.53 |
11:55:21 AM | Motion | 86.68 |
11:55:26 AM | Motion | 87 |
11:55:31 AM | Motion | 89.22 |
11:55:36 AM | Motion | 89.22 |
11:55:41 AM | IDLE OR OFF | 89.22 |
11:55:46 AM | IDLE OR OFF | 87 |
11:55:51 AM | IDLE OR OFF | 87 |
11:55:56 AM | IDLE OR OFF | 87 |
11:56:01 AM | IDLE OR OFF | 87 |
11:56:06 AM | IDLE OR OFF | 86.84 |
11:56:11 AM | IDLE OR OFF | 86.84 |
11:56:16 AM | IDLE OR OFF | 87 |
11:56:21 AM | IDLE OR OFF | 87 |
11:56:26 AM | IDLE OR OFF | 87 |
11:56:31 AM | IDLE OR OFF | 87 |
11:56:36 AM | IDLE OR OFF | 87 |
11:56:41 AM | IDLE OR OFF | 87 |
11:56:46 AM | IDLE OR OFF | 87 |
11:56:51 AM | IDLE OR OFF | 86.84 |
11:56:56 AM | IDLE OR OFF | 86.84 |
11:57:01 AM | IDLE OR OFF | 86.84 |
11:57:06 AM | IDLE OR OFF | 86.84 |
11:57:11 AM | IDLE OR OFF | 86.84 |
11:57:16 AM | IDLE OR OFF | 86.84 |
12:25:07 PM | Motion | 86.21 |
12:25:12 PM | Motion | 85.89 |
12:25:17 PM | Motion | 85.89 |
12:25:22 PM | Motion | 85.89 |
12:25:27 PM | Motion | 87.64 |
12:25:32 PM | Motion | 88.11 |
12:25:37 PM | Motion | 88.27 |
12:25:42 PM | Motion | 88.27 |
12:25:47 PM | Motion | 88.11 |
12:25:52 PM | Motion | 87.48 |
12:25:57 PM | Motion | 86.68 |
12:26:02 PM | Motion | 86.68 |
12:26:07 PM | Motion | 86.68 |
12:26:12 PM | Motion | 86.68 |
12:26:17 PM | Motion | 86.53 |
12:26:22 PM | Motion | 86.53 |
12:26:27 PM | Motion | 86.53 |
12:26:32 PM | Motion | 86.68 |
12:32:07 PM | Motion | 86.68 |
12:32:12 PM | Motion | 87 |
12:32:17 PM | Motion | 87 |
12:32:22 PM | IDLE OR OFF | 87.16 |
12:32:27 PM | IDLE OR OFF | 87.16 |
12:32:32 PM | IDLE OR OFF | 87.16 |
12:32:37 PM | IDLE OR OFF | 87.16 |
12:32:42 PM | IDLE OR OFF | 87.16 |
12:32:47 PM | IDLE OR OFF | 87.16 |
12:32:52 PM | IDLE OR OFF | 87.16 |
12:32:57 PM | IDLE OR OFF | ---- |
12:32:57 PM | IDLE OR OFF | 87 |
12:32:58 PM | IDLE OR OFF | ---- |
12:33:02 PM | IDLE OR OFF | 87 |
12:33:07 PM | IDLE OR OFF | 86.53 |
12:33:12 PM | IDLE OR OFF | 85.73 |
12:33:17 PM | IDLE OR OFF | 85.73 |
12:33:22 PM | IDLE OR OFF | 85.73 |
I took sample from the table to show that there are times when the vehicle is in motion, other times it's ideling.
I need to make a line graph visualization to show the fuel level during the two statuses
But I need it to be a single line and the its color changes as the status changes.
Solved! Go to Solution.
@amaniramahi -
conditional formatting feature is not supported in the default line chart.
Below is the workaround.
create a measure
format =
VAR _status =
SELECTEDVALUE ( FuelTable[Status] )
VAR _color =
IF ( _status = "Motion", "green", IF ( _status = "IDLE OR OFF", "red" ) )
RETURN
_color
Use a clustered column chart and use conditional formatting.
Then switch your bar chart with a line chart.
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
@amaniramahi -
conditional formatting feature is not supported in the default line chart.
Below is the workaround.
create a measure
format =
VAR _status =
SELECTEDVALUE ( FuelTable[Status] )
VAR _color =
IF ( _status = "Motion", "green", IF ( _status = "IDLE OR OFF", "red" ) )
RETURN
_color
Use a clustered column chart and use conditional formatting.
Then switch your bar chart with a line chart.
Did I answer your question? Mark my post as a solution!
Appreciate with a kudos 🙂
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 |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |