Forum Discussion
Change range Y-axis
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
)Thank you for your fast answer. When I try your code I receive the following error:
- Idrissshatila2 years agoSuper User
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 ) - louisquinet2 years agoHelper II
Thank you very much, the error message is gone.
I still have a problem:
So this is a screenshot about how it was before:When I add "Range X-axis as conditional formatting, my graph disappears:
Do you have any idea why?
Thank you for all your help!
Louis
- Idrissshatila2 years agoSuper User
louisquinet , click on the see details of the error and show me the error.
- louisquinet2 years agoHelper II
Sorry, of course 🙂 I forgot to send it.
- Idrissshatila2 years agoSuper User
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 ) - louisquinet2 years agoHelper II
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. 😞 - louisquinet2 years agoHelper II
I remarked that "X axis order" and "X axis fields" possible, but they both don't work 😞
- louisquinet2 years agoHelper II
I see that in my last message was a fault from me, but it still does not work...
This is what I tried now: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]))