Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Max range axis

Hi everyone, I have 2 column values of data, Cash flow and EBITDA, and initially wished to have both columns in the same axis. However it does not seem possible.

Hence, I have arranged them by having 2 bar charts as follows:

As the data bars are not sized accordingly, I wish to set the x-axis limit to be the max of all the column values, such that the data bars are shown proportionately.

- I used the max function to get the maximum value, and added it to the max range as below.

However, I am still unable to set the max axis to be similar to the above screenshot.  

Would anyone know how I can fix the max limit range of my axis?

Thank you!

 

 

  • Hi Anonymous ,

     

    Please try:

    MAX VALUE2 = 
    var _a = CALCULATE(SUM('Case'[Actual]),FILTER(ALLEXCEPT('Case','Case'[Date]),[EBITDA]="EBITDA"))
    var _b = CALCULATE(SUM('Case'[Forecast]),FILTER(ALLEXCEPT('Case','Case'[Date]),[EBITDA]="EBITDA"))
    var _c = CALCULATE(SUM('Case'[Actual]),FILTER(ALLEXCEPT('Case','Case'[Date]),[Cash Flow]="Cash Flow"))
    var _d = CALCULATE(SUM('Case'[Forecast]),FILTER(ALLEXCEPT('Case','Case'[Date]),[Cash Flow]="Cash Flow"))
    return MAXX({_a,_b,_c,_d},[Value])

    Final output:

    Best Regards,

    Jianbo Li

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

6 Replies

  • Hi Anonymous ,

     

    Based on your description, I have created a simple sample:

    Please try:

    Max Value = 
    var _a = MAX('Table'[A])
    var _b = MAX('Table'[B])
    return MAXX({_a,_b},[Value])

    Final output:

    Best Regards,

    Jianbo Li

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

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Jianbo,

       

      Greatly appreciate your help!

      My current data structure is like this, where the attributes are in two separate columns:

       

      I'm not able to have both graphs in a single chart.

      Hence I had to put it into 2 separate charts, and I wish to have the charts both at 600 plus max axis:

       

      I actually added it onto your power bi file, but somehow can't seem to add the file here ğŸ˜…

       

      These were my measures:

      Cashflow Actual = CALCULATE(SUM('Case'[Actual]),'Case'[Cash Flow]="Cash Flow")
      Cashflow Forecast = CALCULATE(SUM('Case'[Forecast]),'Case'[Cash Flow]="Cash Flow")

      Max Cashflow actual/forecast =
      var _a = [Cashflow Actual]
      var _b = [Cashflow Forecast]
      return MAXX({_a,_b},[Value])

       

       

       

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

        Hi Anonymous ,

         

        Please try:

        MAX VALUE = 
        var _a = CALCULATE(SUM('Case'[Actual]),FILTER(ALL('Case'),[EBITDA]="EBITDA"))
        var _b = CALCULATE(SUM('Case'[Forecast]),FILTER(ALL('Case'),[EBITDA]="EBITDA"))
        var _c = CALCULATE(SUM('Case'[Actual]),FILTER(ALL('Case'),[Cash Flow]="Cash Flow"))
        var _d = CALCULATE(SUM('Case'[Forecast]),FILTER(ALL('Case'),[Cash Flow]="Cash Flow"))
        return MAXX({_a,_b,_c,_d},[Value])

        Final output:

        Best Regards,

        Jianbo Li

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