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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Krlos5411
Frequent Visitor

Line graph with two colors based on a paramether value????

Hello experts,

 

Quick question if anyone knows that is possible.

 

I have a line graph with weekly values, those values depends of the data that is updated weekly.

And I have a paramether that can be manually modified by the user. But this value is used only to have a minimun a acceptable value.

 

There's a way where I can change the color of the weekly values that came from databricks, base on the value of the paramether?

 

Above green and below red, like this:

Krlos5411_0-1741049061546.png

 

5 REPLIES 5
v-kathullac
Community Support
Community Support

Hi @Krlos5411 ,

we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.

If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.


Regards,

Chaithanya.

v-kathullac
Community Support
Community Support

Hi @Krlos5411 ,

we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.

If our super user response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.


Regards,

Chaithanya.

freginier
Super User
Super User

Hey there!

 

You could try creating a measure for conditional coloring. Like this: 

Line_Color =
VAR Threshold = SELECTEDVALUE(ParameterTable[ParameterValue])
VAR CurrentValue = SELECTEDVALUE(YourData[WeeklyValue])

RETURN
IF(CurrentValue >= Threshold, "Green", "Red")

-------Replace ParameterTable[ParameterValue] with the actual parameter table column.
-------Replace YourData[WeeklyValue] with your dataset's weekly values.

 

And then apply conditional formatting in the line chart. :

- Select the line graph.
- Click on the Format pane (paint roller icon).
- Go to the Data Colors section.
-Click on the fx (conditional formatting) next to the line color.
-Choose "Based on field", then select the Line_Color measure.

 

With this, when the weekly value is above the parameter → Line turns green.
When the weekly value is below the parameter → Line turns red.

 

Hope this helps!

😁😁
Set "Green" to one color (e.g., Green) and "Red" to another (e.g., Red).

Thansk for the guide.

 

I think I got all correct. But I don't have the fx button next to the line color option

Krlos5411_1-1741113304739.png

 

 

Hi ,

 

I'm not sure you can achive this using one line , you will need two lines for this one for green and the other for red

 

kushanNa_0-1741155723718.png

 

steps to get the above result 

 

1. create two mesure for green and red 

 

 

RedLineMeasure = 
VAR Threshold = SELECTEDVALUE(ParameterTable[ParameterValue])
VAR AvgLeadTime = AVERAGEX(
    YourData,
    DATEDIFF(YourData[LeadTime_Date], YourData[Date], DAY)
)
RETURN
IF(AvgLeadTime <= Threshold, AvgLeadTime, BLANK())

GreenLineMeasure = 
VAR Threshold = SELECTEDVALUE(ParameterTable[ParameterValue])
VAR AvgLeadTime = AVERAGEX(
    YourData,
    DATEDIFF(YourData[LeadTime_Date], YourData[Date], DAY)
)
RETURN
IF(AvgLeadTime >= Threshold, AvgLeadTime, BLANK())

 

2.  add the following values to line chart 

kushanNa_1-1741155888413.png

3. and color code each lines , i have shown in here green as an example 

kushanNa_2-1741155963265.png

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.