Forum Discussion

jithesh's avatar
jithesh
New Member
5 years ago
Solved

Total in the bar chart

Hi,

 

I have month on month sales data. I want to show the total also in the graph. I want sales in the X axis and the managre names in the Y axis. Month as Legend.

 

ManagerSalesMonth
Andy92925Aug-20
Brad5672Aug-20
Cooper4861Aug-20
David3525Aug-20
Emily347Aug-20
Frank311Aug-20
Henry12Aug-20
Glen1Aug-20
Andy92743Sep-20
David3436Sep-20
Cooper1023Sep-20
Emily221Sep-20
Glen81Sep-20
Frank72Sep-20
  • Hi, jithesh 

     

    It’s my pleasure to answer for you.

    According to your description,I think you may need to create a table with a single column,then use this column in the visual instead of 'manager',then create a measure instead of values.

    Like this:

    Table 2 = UNION(DISTINCT('Table (2)'[Manager]),ROW("Manager","Total"))
    
    Measure =
    IF (
        SELECTEDVALUE ( 'Table 2'[Manager] ) = "Total",
        SUMX (
            FILTER ( ALL ( 'Table (2)' ), [Month] = SELECTEDVALUE ( 'Table (2)'[Month] ) ),
            [Sales]
        ),
        SUMX (
            FILTER (
                ALL ( 'Table (2)' ),
                [Month] = SELECTEDVALUE ( 'Table (2)'[Month] )
                    && [Manager] = SELECTEDVALUE ( 'Table 2'[Manager] )
            ),
            [Sales]
        )
    )

     

    Here is my sample .pbix file.Hope it helps.

    If it doesn’t solve your problem, please feel free to ask me.

     

    Best Regards

    Janey Guo

     

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

4 Replies

  • v-janeyg-msft's avatar
    v-janeyg-msft
    Icon for Community Support rankCommunity Support

    Hi, jithesh 

     

    It’s my pleasure to answer for you.

    According to your description,I think you may need to create a table with a single column,then use this column in the visual instead of 'manager',then create a measure instead of values.

    Like this:

    Table 2 = UNION(DISTINCT('Table (2)'[Manager]),ROW("Manager","Total"))
    
    Measure =
    IF (
        SELECTEDVALUE ( 'Table 2'[Manager] ) = "Total",
        SUMX (
            FILTER ( ALL ( 'Table (2)' ), [Month] = SELECTEDVALUE ( 'Table (2)'[Month] ) ),
            [Sales]
        ),
        SUMX (
            FILTER (
                ALL ( 'Table (2)' ),
                [Month] = SELECTEDVALUE ( 'Table (2)'[Month] )
                    && [Manager] = SELECTEDVALUE ( 'Table 2'[Manager] )
            ),
            [Sales]
        )
    )

     

    Here is my sample .pbix file.Hope it helps.

    If it doesn’t solve your problem, please feel free to ask me.

     

    Best Regards

    Janey Guo

     

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

  • Hi Phil

    It should be the overall sales for each manager.