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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Dunner2020
Post Prodigy
Post Prodigy

line graph coloring based on

Hi there,

 

I have three measures that created the lines on a line graph as shown below. 

 

myasir_0-1602728865945.png

Now I don't want to display the Upper limit and lower limit lines for the months that are gone. For example, I don't want to show the lines for uppper and lower limit from April to October as they are passed now as  shown in the picture below:

 

myasir_1-1602729729890.png

Is there any way in power BI that we could setup the line color of the graph to transparent white for the months that are gone??

 

1 ACCEPTED SOLUTION

@Dunner2020 , Try like

 

Upper Limit new = if(max(Date[date])> eomonth(today(),0), [Upper Limit], [Actutal value])

 

Lower Limit new = if(max(Date[date])> eomonth(today(),0), [Lower Limit], [Actutal value])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Dunner2020 , Set you upper limit

 

limit

Upper Limit new = if(max(Date[date])> eomonth(today(),0), [Upper Limit], blank())

 

lower Limit new = if(max(Date[date])> eomonth(today(),0), [lower Limit], blank())

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak @Megha166 , wow it works. Thanks for the reply. 

 

myasir_1-1602731948664.png

 

 

Before I accept the reply as a solution, quick question is it possible to joint the upper and lower limits to the actual value line for the passed months (as shown in the picture)

 

myasir_0-1602731936199.png

 

I tried the following measures to generate similar thing:

Lower Limit new =
Var _CYMonth = MONTH(TODAY())
Var _RYMonth = if(_CYMonth > 3 && _CYMonth <= 12, _CYMonth - 3,_CYMonth + 9)
Return
IF(max(Dates[RY Month Number])> _RYMonth, [Lower Limit], [Actual Value])
 

 

Upper Limit new =
Var _CYMonth = MONTH(TODAY())
Var _RYMonth = if(_CYMonth > 3 && _CYMonth <= 12, _CYMonth - 3,_CYMonth + 9)
Return
IF(max(Dates[RY Month Number])> _RYMonth, [Upper Limit], [Actual Value])

 

It produced the following output

Screenshot 2020-10-14 190912.jpg

 

As you can see that the color of actual value is changed and to brown. Is there any way of doing that?

Thanks :). Amit already my solution to your question.😊

@Dunner2020 , Try like

 

Upper Limit new = if(max(Date[date])> eomonth(today(),0), [Upper Limit], [Actutal value])

 

Lower Limit new = if(max(Date[date])> eomonth(today(),0), [Lower Limit], [Actutal value])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Megha166
Microsoft Employee
Microsoft Employee

You can write new measures for upper limit and lower limit and set them to zero for all the months prior to current month and then plot them on line graphs.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors