Forum Discussion

deedoubleewe's avatar
deedoubleewe
New Member
10 months ago
Solved

Creating a dynamic y-axis on a clustered column chart with a legend

I have a clustered column chart (shown below) that graphs the Pct Value for each legend category (Legend) within each x-axis group (A and B).  I want to use a measure to create a dynamic y-axis maxim...
  • OwenAuger's avatar
    10 months ago

    Hi deedoubleewe 

    The immediate issue appears to be that the maximum value should be determined at the granularity of the Legend & the X-Axis field combined.

     

    Assuming the field on the X-Axis is Table[Category], something like this should work as expected:

    YAxis Max =
    CEILING (
        MAXX (
            SUMMARIZECOLUMNS ( Table[Legend], Table[Category], "@Value", [Value] ),
            [@Value]
        ) + .05,
        0.2
    )

     

    You can debug or verify that YAxis Max is returning the expected value by displaying it on a separate Card visual (subject to the same filters applying to the original visual).

     

    Does something like this work for you?