Forum Discussion
Set graph values dynamically on dataset change
- 6 years ago
If you unpivot your data such that there is one row per sensor with a column that has the sensor name. You can put the sensor value in the values of the visual and sensor name column in the legend.
- Anonymous6 years ago
Hi,
So I tried unpivoted my data just like you suggested.
and it worked after I add some more tweak.
for references:
1. I import my original data without unpivot it
2. I create another power query and this time I add unpivot process and get my unpivoted data
3. after I create both of these tables, I connected both of their models and set the connection into both ways.
4. then I mapped my unpivoted data into my graph,
- Time as Axis
- Value as Values
- Attributes as Legends
with this, my graph could add and remove its values dynamically.
thank you
I mean your data should look like:
| time | sensor name | sensor value |
| 100 | sensor1 | 0 |
| 100 | sensor2 | 1 |
| 200 | sensor1 | 1 |
| 200 | sensor2 | 2 |
Then put "sensor name" into legend and "sensor value" into values
Hi,
So I tried unpivoted my data just like you suggested.
and it worked after I add some more tweak.
for references:
1. I import my original data without unpivot it
2. I create another power query and this time I add unpivot process and get my unpivoted data
3. after I create both of these tables, I connected both of their models and set the connection into both ways.
4. then I mapped my unpivoted data into my graph,
- Time as Axis
- Value as Values
- Attributes as Legends
with this, my graph could add and remove its values dynamically.
thank you