Forum Discussion

Hidrolix's avatar
Hidrolix
Frequent Visitor
2 years ago
Solved

Measure on Axis in grouped bar chart

Hello all,   This is my first project, so it is still a steep learning curve for me. I checked the forum I saw some related items, but still could not get it to work. So I hope you guys and girls c...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Hidrolix ,

    The reason that the measure you create can only go to the legend and not to the y-axis is that all measures return a text type result and not a number. Please add "VALUE( " at the beginning of all measures and " )" at the end.

    2U Count = 
    VAR __text = SELECTEDVALUE( 'ContiguousUSpace'[ContiguousUSpace] )
    VAR A =
    LEFT( 
            __text, 
            SEARCH( ",", __text, 1, 1 ) -1 
        )
    RETURN 
        VALUE(A)
    3U Count = 
    VALUE(PATHITEM(SUBSTITUTE('ContiguousUSpace'[Calc ContiguousUspace],",", "|"), 2))
    4U Count = 
    VALUE(PATHITEM(SUBSTITUTE('ContiguousUSpace'[Calc ContiguousUspace],",", "|"), 3))

    The final output is below:

    Please adjust the number of decimal places.


    Best Regards,
    Dino Tao
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.