Forum Discussion
Max y-axis based on field parameter selected
You can handle this by using SELECTEDVALUE() on your field parameter table and conditionally computing the max based on which measure is active.
Step 1. Create your field parameter (which you already have):
Measure Parameter =
{ ("Name1", NAMEOF([Measure1]), 0),
("Name2", NAMEOF([Measure2]), 1),
("Name3", NAMEOF([Measure3]), 2) }
Step 2. Create a new measure for Dynamic Y-Axis Max:
Dynamic Y-Axis Max =
VAR SelectedMeasure = SELECTEDVALUE('Measure Parameter'[Name])
VAR MaxValue = SWITCH( SelectedMeasure, "Name1",
MAXX(ALLSELECTED('YourMainDataTable'), [Measure1]), "Name2",
MAXX(ALLSELECTED('YourMainDataTable'), [Measure2]), "Name3",
MAXX(ALLSELECTED('YourMainDataTable'), [Measure3]) )
VAR PaddedValue = MaxValue * 1.15
VAR RoundedValue =
SWITCH(
TRUE(),
MaxValue = 0, 10,
PaddedValue > 500, ROUNDUP(PaddedValue, -2),
PaddedValue > 100, CEILING(PaddedValue, 50),
PaddedValue > 10, CEILING(PaddedValue, 10),
CEILING(PaddedValue, 5) )
RETURN RoundedValue
Use this measure to drive the Y-axis in your chart
Hi nleuck_101 ,
As I am also a member of the CST team, I wanted to follow up regarding the issue.
I hope the information provided helps resolve your issue. If you have any further questions or need additional assistance, please feel free to contact us. We are here to help.
Best Regards,
Community Support Team
- v-menakakota10 months agoCommunity Support
Hi @nleuck_101 ,
As I am also a member of the CST team, I wanted to follow up regarding the issue.
I hope the information provided helps resolve your issue. If you have any further questions or need additional assistance, please feel free to contact us. We are here to help.
Best Regards,
Community Support Team