Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Set graph values dynamically on dataset change

Hi,

 

I don't know if this could be done with PowerBI or not.

when I try to create a graph like a line graph :

graph.PNG

I always set the graph values from PBI UI :

setting.PNG

 

what I want to do is not to do these values set by this UI, but I want to set the values dynamically from power query or measure maybe.

my question would be :

1. is it possible to do this in PowerBI?either by using measure or power query

2. if it's possible is there any tutorial or any documents that I could read to learn about this more?

 

bests,

2 ACCEPTED SOLUTIONS
artemus
Microsoft Employee
Microsoft Employee

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.

View solution in original post

Anonymous
Not applicable

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

View solution in original post

4 REPLIES 4
artemus
Microsoft Employee
Microsoft Employee

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.

Anonymous
Not applicable

Hi Artemis,

 

thank you for your reply.

when you said unpivot my data, does it means to change my data from:

timesensor1sensor2
10001
20012

 

to this?

col1col2col3
time100200
sensor101

 

if yes, I think I could do it, but still I don't understand how to map these data without me selecting it manually from PowerBI UI. s

I mean your data should look like:

timesensor namesensor value
100sensor10
100sensor21
200sensor1

1

200sensor2

2

 

Then put "sensor name" into legend and "sensor value" into values

Anonymous
Not applicable

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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.