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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
louisquinet
Helper II
Helper II

Change range Y-axis

Hello

In my scatter chart the highest value is not very visible. It is always at the maximum and because of that you can only see half a circle or even a quarter of a circle. I would like to change the range of my x and y-axis (which is now (0,Auto)) to (0,max + 5%). Does anyone know how I have to do this? I have no experience with functions in Power BI and after some trial and error I still don't know how to do it...

Thank you in advance
Louis

louisquinet_0-1707379169045.pnglouisquinet_1-1707379201014.png

 

 

 

21 REPLIES 21
Idrissshatila
Super User
Super User

HEllo @louisquinet ,

 

create a measure to calculate the number of current + 5% and add it in the fx in the maximum to be dynamic.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Thank you very much! It works 🙂

I still have an aditional question.

I have the possibility to change my x-axis as you can see on the screenshot. At this moment it works perfectly for the net unit price but when I change it to maintenance cost (which is mucg lower) it keeps the same range for the x-axis which is really not convenient. Do you know how to do change this?

louisquinet_0-1707381026119.png

 

 

louisquinet_1-1707381055035.png

louisquinet_3-1707381101469.pnglouisquinet_2-1707381087394.png

louisquinet_4-1707381141852.png

 

 

Hello @louisquinet ,

 

try this instead of your measure and specify the number you want to multiply the value with in the second condition

Measure = 
SWITCH(
    TRUE(),
    ISFILTERED('Pricing_Benchmark'[Net Unit Price]) = TRUE(), 1.05 * SELECTEDVALUE('Pricing_Benchmark'[Net Unit Price]]),
    ISFILTERED('Pricing_Benchmark'[Maintenance Cost]) = TRUE(), 2 * SELECTEDVALUE('Pricing_Benchmark'[Maintenance Cost]),
    // Add more conditions as needed
    BLANK() // Default value if no conditions are met
)

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Hello

Thank you for your fast answer!

I tried what you told me, you can see the screenshots bellow, but unfortunatelly it is again like before. The maximum of the range is the max value and not the max value *1.05.
Do you know what I did wrong or what I should change to make it work?
Thank you in advance

Louis

louisquinet_0-1707385642997.png

louisquinet_1-1707385670299.pnglouisquinet_2-1707385684828.png

louisquinet_3-1707385730784.png

 

 

@louisquinet ,

 

are you using field parameters ?

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Yes 🙂

@louisquinet ,

 

can you show me the field parameters code



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




louisquinet_0-1707390235813.png

X axis = {
    ("Net Unit Price", NAMEOF('Pricing_Benchmark'[Net Unit Price]), 0),
    ("Maintenance Cost", NAMEOF('Pricing_Benchmark'[Maintenance Cost]), 1)
}

@louisquinet ,

the column names of the field parameters please.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Sorry I'm not sure that I understand your question right, do you mean
Net Unit Price

Maintenance Cost

?

@louisquinet ,

 

try this 

 

Measure = 
SWITCH(
    TRUE(),
    SELECTEDVALUE('X axis'[Parameter]) = "Net Unit Price", 1.05 * SELECTEDVALUE('Pricing_Benchmark'[Net Unit Price]]),
    SELECTEDVALUE('X axis'[Parameter]) = = "Maintenance Cost", 2 * SELECTEDVALUE('Pricing_Benchmark'[Maintenance Cost]),
    // Add more conditions as needed
    BLANK() // Default value if no conditions are met
)


Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Thank you for your fast answer. When I try your code I receive the following error:

louisquinet_0-1707393193121.png

 

@louisquinet ,

 

try this

Measure = 
SWITCH(
    TRUE(),
    SELECTEDVALUE('X axis'[X axis]) = "Net Unit Price", 1.05 * SELECTEDVALUE('Pricing_Benchmark'[Net Unit Price]]),
    SELECTEDVALUE('X axis'[X axis]) = = "Maintenance Cost", 2 * SELECTEDVALUE('Pricing_Benchmark'[Maintenance Cost]),
    // Add more conditions as needed
    BLANK() // Default value if no conditions are met
)


Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Thank you very much, the error message is gone.

I still have a problem:
So this is a screenshot about how it was before:

louisquinet_1-1707394688219.png

When I add "Range X-axis as conditional formatting, my graph disappears:

louisquinet_2-1707394793730.png

louisquinet_3-1707394846934.png

Do you have any idea why?

Thank you for all your help!

Louis

 

@louisquinet , click on the see details of the error and show me the error.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Sorry, of course 🙂 I forgot to send it.

louisquinet_0-1707395530999.png

 

@louisquinet ,

try this

Measure = 
SWITCH(
    TRUE(),
    SELECTEDVALUE('X axis'[order]) = 0, 1.05 * SELECTEDVALUE('Pricing_Benchmark'[Net Unit Price]]),
    SELECTEDVALUE('X axis'[order]) = 1, 2 * SELECTEDVALUE('Pricing_Benchmark'[Maintenance Cost]),
    // Add more conditions as needed
    BLANK() // Default value if no conditions are met
)


Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




I see that in my last message was a fault from me, but it still does not work...
This is what I tried now:

louisquinet_0-1707466067481.png

Range X-axis =
SWITCH(
    TRUE(),
    SELECTEDVALUE('X axis'[X axis Order]) = 0, 2 * SELECTEDVALUE('Pricing_Benchmark'[Net Unit Price]),
    SELECTEDVALUE('X axis'[X axis Order]) = 1, 2 * SELECTEDVALUE('Pricing_Benchmark'[Maintenance Cost])
)

I remarked that "X axis order" and "X axis fields" possible, but they both don't work 😞

louisquinet_1-1707464976672.pnglouisquinet_2-1707465004742.png

Hi!

Thank you for your answer!
Power BI gives me this error message: Column 'order' in table 'X axis' cannot be found or may not be used in this expression. 😞

louisquinet_0-1707464161499.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.