Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Summarize 2 groups on a stacked bar chart

Is there a Power Bi feature that will summarize (add) 2 groups on a stacked bar chart that has a total of 4 groups (as pictured)? I do not want to use Quick measure as that feature adds a 5th group t...
  • v-yadongf-msft's avatar
    4 years ago

    Hi Anonymous ,

     

    This is my test table:

     

    The chart visual:

     

    Please create a new column:

    Column = SWITCH(
        TRUE(),
        'Table'[Type] = "C", CALCULATE(SUM('Table'[Value]),FILTER('Table', ('Table'[Type] = "C" || 'Table'[Type] = "D") && 'Table'[Item] = EARLIER('Table'[Item]))),
        'Table'[Type] = "D",BLANK(),
        'Table'[Value])

     

    I think this is the result you want:

     

    Best regards,

    Yadong Fang

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