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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
jaryszek
Memorable Member
Memorable Member

Create a min and max line between 2 specified lines in line chart

Hello, 

I created line chart like here: 

jaryszek_1-1758180361901.png

 

But i want to now find a diff between first line which is "On Demand" and second line which is "Reservation":

 

jaryszek_0-1758180344846.png

So first adding a dashed line from min point from "OnDemand" , after drowing dashed line for max "Reservation" and as last step, see the diff between them.

 

Here the link to example model:

https://drive.google.com/file/d/13wn-vSyg5q2mvU5KtWzMSiPZWHDHGxVR/view?usp=sharing 

How to achive it?

Best,
Jacek

 

1 ACCEPTED SOLUTION
Sergii24
Super User
Super User

Hi, @jaryszek, here is what you need to do to achieve the result like in the image below 😉

Sergii24_0-1761208965781.png

 

I'll keep DAX part aside, which was excelently explained by @FBergamaschi and will only focus on the visual one.

Suppose you already have Min and Max lines (calcualted using DAX or even some fixed values). To plot them in addition to the standard lines you need to use "Reference lines" formatting option. Within it, you select "Y-Axis constant line". At this point, you'll get 2 lines you're interested it. Now we need to higlight area between them. However, you can add shade only before or after the a reference line, not between 2 reference lines.

See Step1 in the image above: when I apply shade area with a position "After" it will shade everything from Min line and above. Now, I need to get rid of the shade above Max line. To obtain the result from the step 2 you simply repeat the same for Max line (shade with position after) and select white color. It's important to make transparency equal to 0, otherwise you'll still see some part of shade from Min line, which is above Max.

Hope it helps! See pbix attached for details and good luck with your project!

View solution in original post

12 REPLIES 12
Sergii24
Super User
Super User

Hi, @jaryszek, here is what you need to do to achieve the result like in the image below 😉

Sergii24_0-1761208965781.png

 

I'll keep DAX part aside, which was excelently explained by @FBergamaschi and will only focus on the visual one.

Suppose you already have Min and Max lines (calcualted using DAX or even some fixed values). To plot them in addition to the standard lines you need to use "Reference lines" formatting option. Within it, you select "Y-Axis constant line". At this point, you'll get 2 lines you're interested it. Now we need to higlight area between them. However, you can add shade only before or after the a reference line, not between 2 reference lines.

See Step1 in the image above: when I apply shade area with a position "After" it will shade everything from Min line and above. Now, I need to get rid of the shade above Max line. To obtain the result from the step 2 you simply repeat the same for Max line (shade with position after) and select white color. It's important to make transparency equal to 0, otherwise you'll still see some part of shade from Min line, which is above Max.

Hope it helps! See pbix attached for details and good luck with your project!

O wow you are the boss!!!

Amazing. 

Thank you very much,
Best,
Jacek

v-echaithra
Community Support
Community Support

Hi @jaryszek ,

We’d like to follow up regarding the recent concern. Kindly confirm whether the issue has been resolved, or if further assistance is still required. We are available to support you and are committed to helping you reach a resolution.

Best Regards,
Chaithra E.

v-echaithra
Community Support
Community Support

Hi @jaryszek ,

We’d like to follow up regarding the recent concern. Kindly confirm whether the issue has been resolved, or if further assistance is still required. We are available to support you and are committed to helping you reach a resolution.

Best Regards,
Chaithra E.

Hello thanks,

no still didn't get what i wanted. 
@FBergamaschi  was close to it 🙂 


Best,
Jacek

It is not resolved, please see my anwer to @FBergamaschi . 

I have isssues with implementing this solution and have questions...

Best,
Jacek

Hi @jaryszek ,

Thank you for the update.
Please refer to the pbix file attatched.
Hope this resolves your issue.

Thank you

v-echaithra
Community Support
Community Support

Hi @jaryszek ,

Thank you @FBergamaschi  for your inputs.

I hope the information provided is helpful. I wanted to check whether you were able to resolve the issue with the provided solutions. Please let us know if you need any further assistance.

Thank you.

 

FBergamaschi
Solution Sage
Solution Sage

There are two ways

 

1 create a measure

 

Delta =
CALCULATE( Sum (fct_amortizedcosts[CostInBillingCurrency]), fct_amortizedcosts[PricingModel] = "OnDemand" ) -
CALCULATE( Sum (fct_amortizedcosts[CostInBillingCurrency]), fct_amortizedcosts[PricingModel] = "Reservation" )
 
but this cannot be added since you have a legend in place, so you would need to show this in a separate graph
 
If you want to do the thing in the same graph, a visual calculation can work but you will be able to show only either the visual calc and the measure you alreay have (sum of....) without legend, or show the measure you have with legend but hid the visual calc
 
Delta VC =
CALCULATE( [Sum of CostInBillingCurrency], [PricingModel] = "OnDemand" ) -
CALCULATE( [Sum of CostInBillingCurrency], [PricingModel] = "Reservation" )
 
So the best would be to create single measures for On Demand Reservations etc and then add the visual calc
 
At the moment I see ony these 3 options
 
 

If this helped, please consider giving kudos and mark as a solution

@mein replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

thank you very much.

I created for the example 2 measures:

OnDemand Measure = 
    CALCULATE(
        SUM(fct_amortizedcosts[CostInBillingCurrency]), 
        fct_amortizedcosts[PricingModel] = "OnDemand"
        )

 

Reservation Measure = 
    CALCULATE(
        SUM(fct_amortizedcosts[CostInBillingCurrency]), 
        fct_amortizedcosts[PricingModel] = "Reservation"
        )

 

and created delta:

Delta = [OnDemand Measure] - [Reservation Measure]


But have the issue with figuring out what is a Visual Calc in yuor words ans how toshow this delta properly?:

In a screen it loos like:

jaryszek_1-1758529018880.png


(orange line). 

How to show this the diff like I shown in the previous screen? It is possible to show as area ? 

I have updated example model:
https://drive.google.com/file/d/13wn-vSyg5q2mvU5KtWzMSiPZWHDHGxVR/view?usp=sharing 

Best,
Jacek

Hi @jaryszek ,

sorry for late reply, here is how to create a visual calculation, then you can try to format is through the format pane, I am not sure if you can format as an area, it is still in preview

 

FBergamaschi_0-1758971627311.png

 

 

FBergamaschi_1-1758971703837.png

 

Sorry again for being late, I was traveling

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

Thank you, 

no problem. 

Hmm I am feeling like an idiot and have the issue with implementing this still. 

I tried with custom calculation:

jaryszek_0-1759303499734.png



but why I can not put measures into it? It should be Delta measure or which one? 

 

https://drive.google.com/file/d/14lpEWK-MQ6JMU5_15WVh8Gv22AiGvdpR/view?usp=sharing 


Best,
Jacek



Helpful resources

Announcements
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!

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.

Top Solution Authors