Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Chart axis: Combine axis name + measure value

Hello everyone, 

 

I'm in the need of having a simple chart with the value of a axis name + measure value, i.e  "Chevrolet - 96%", etc...   I was wondering if this is posible, something as the screenshot below, so I can remove the secondary axis and the line with markers.

 

BTW I'm using Excel + PowerPivot , not PowerBI.

 

 

  • Hi Anonymous ,

    Maybe you could try to create a calculated column to replace the measure. Then use the column as X-axis. I created a sample that you can reference.

    Measure = DIVIDE(SUM('Table'[Sales])-SUM('Table'[Profit]),SUM('Table'[Sales]))
    
    Column = 
    var a = CALCULATE(SUM('Table'[Sales])-SUM('Table'[Profit]),ALLEXCEPT('Table','Table'[Country]))
    var b = CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Country]))
    var c = FORMAT(DIVIDE(a,b),"00%")
    return
    'Table'[Country] & " - " &c

    Best Regards,

    Xue Ding

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

6 Replies

  • Anonymous unfortunately you cannot have measure on x-axis, but it can be achieved by creating calculated table and creating measure as column. In other words, it can be achieved but not straight forward.

    • Anonymous's avatar
      Anonymous
      Not applicable

      parry2k  thanks for your quick reply, I'm getting starting with DAX  do you have an example by any chance so I can have a better understanding about your comment. 

       

      Thanks again!

       

       

      • v-xuding-msft's avatar
        v-xuding-msft
        Community Support

        Hi Anonymous ,

        Maybe you could try to create a calculated column to replace the measure. Then use the column as X-axis. I created a sample that you can reference.

        Measure = DIVIDE(SUM('Table'[Sales])-SUM('Table'[Profit]),SUM('Table'[Sales]))
        
        Column = 
        var a = CALCULATE(SUM('Table'[Sales])-SUM('Table'[Profit]),ALLEXCEPT('Table','Table'[Country]))
        var b = CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Country]))
        var c = FORMAT(DIVIDE(a,b),"00%")
        return
        'Table'[Country] & " - " &c

        Best Regards,

        Xue Ding

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