Forum Discussion
Dynamic Y-axis range in Line chart
Hello!
I have four line charts shown next to each other. They contain the same data F_merged[Value] but there us a filter used on each of them.
I need to have the same Y-axis range for all four charts. If all of them are showing values less than 50, the range should go from 0 to 50. If at least one of them is showing value greater than 50, ranges for all four charts should go from 0 to 100.
I am using measure to set the Maximum for Y-axis (based on find the highest value among those plotted in the chart:
F_YMax = IF(MAX(F_merged[Value]) = 0, 50, IF(CEILING(MAX(F_merged[Value]),10)<60,CEILING(MAX(F_merged[Value]),50),100))
- Anonymous1 year ago
Hi aileenkaz , hello parry2k, thank you for your prompt reply!
Please try the following measure:
ValueMeasure = MAX('Table'[Value])F_YMax = IF( MAXX(ALL('Table'), 'Table'[ValueMeasure]) = 0, 50, IF( CEILING(MAXX(ALL('Table'), 'Table'[ValueMeasure]), 10) < 60, CEILING(MAXX(ALL('Table'), 'Table'[ValueMeasure]), 50), 100 ) )Result:
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 Replies
- aileenkazFrequent Visitor
I tried, but the result is the same 😞
It seems the value of F_YMax is calculated for each graph separately.
- aileenkazFrequent Visitor
If I use ALL, F_YMax is always 100 (even if all plotted values in the four graphs are less than 50).
- AnonymousNot applicable
Hi aileenkaz , hello parry2k, thank you for your prompt reply!
Please try the following measure:
ValueMeasure = MAX('Table'[Value])F_YMax = IF( MAXX(ALL('Table'), 'Table'[ValueMeasure]) = 0, 50, IF( CEILING(MAXX(ALL('Table'), 'Table'[ValueMeasure]), 10) < 60, CEILING(MAXX(ALL('Table'), 'Table'[ValueMeasure]), 50), 100 ) )Result:
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.