Forum Discussion

Jay20024's avatar
Jay20024
Icon for Helper I rankHelper I
1 year ago
Solved

Custom horizontal barchart

Hi, For esthetic purpose, I like to create a horizontal stack barchart with values, that looks like a 100% stacked barchart. So i need to calculate the most expensive category, substracting the res...
  • bhanu_gautam's avatar
    1 year ago

    Jay20024 Create a new measure to calculate the total cost for each category.
    Create another measure to calculate the GAP.

     

    TotalCost = SUM('YourTable'[Cost])

    MaxCost = CALCULATE(MAXX(ALL('YourTable'[Category]), [TotalCost]))

    GAP = [MaxCost] - [TotalCost]

     

    Add a stacked bar chart to your report.
    Drag the Category field to the Axis.
    Drag the TotalCost measure to the Values.
    Drag the GAP measure to the Values.