Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
harirao
Post Prodigy
Post Prodigy

How to create a new bar in Clustered column chart showing total of three Months

Hello, I have a clustered bar chart, were i have taken Attributes as Months and Values, selected only three months, now i want to add a bra which should be sum of three months values

How can I do this in Power Bi?
Capture1.PNG
I am looking similar solution as created in MS Excel.
Capture2.PNG
Please assist me.

Thank you!

1 ACCEPTED SOLUTION
Arul
Super User
Super User

@harirao ,

try the following steps.

1. Create a calculated table for months and then total to be shown in the visual,

Months = 
UNION(
    VALUES(
        Table[Month Name]),
        ROW("Column1","Total")
)

Arul_0-1680606066566.png

2. Create a incative relationship between newly created table and the existing table with Month name as a common key between the tables,

Arul_1-1680606147591.png

3. Write the below measure,

Sales Total Measure = 
VAR _selected = SELECTEDVALUE(New Table[Month Name])
VAR _result = IF(
    _selected = "Total",CALCULATE(
        SUM(Table[ Sales]),
        ALLSELECTED(New Table[Month Name]),
        USERELATIONSHIP(Table[Month Name],New Table[Month Name])),
    CALCULATE(
        SUM(
            Table[ Sales]),
            Table[Month Name] = _selected)
)
RETURN _result

4. Use the newly created month names and measure in the visual,

Arul_2-1680606440737.png

Thanks,

Arul

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


View solution in original post

7 REPLIES 7
harirao
Post Prodigy
Post Prodigy

@joaoribeiro 

As per the solution mentioned above from @Arul, i have Create a calculated table for months.
so now i am unable to see 'STARTOFMONTH(date)' in Data
Capture4.PNG


Thank you

 

Regards,

joaoribeiro
Impactful Individual
Impactful Individual

@harirao  you can add one more column to your auxiliary table. Please consider the code below, and adjust as needed for your specific case:

Previous Q =
UNION(
DISTINCT(SELECTCOLUMNS(Unpivot_Data, Unpivot_Data[Attribute], Unpivot_Data[StartOfMonth])),
ROW("Column1", "Previous Q", "Column2", 99999)
)
//Column2 as 99999 will set the Previous Q line with a date in the future, so it will be sorted as the last value always



Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️or giving it a kudoe 👍

Thanks!

Best regards,
Joao Ribeiro

Hi @joaoribeiro 
Is there any other solution for Sort Months?
Still not getting correctly result, after doing above mentioned work around.
Capture5.PNG
Data is not visible after adding Column2
Capture6.PNG

Thank you

 

Regards,

Hari

harirao
Post Prodigy
Post Prodigy

@Arul 

By using the above logic i got the solution, now facing the challenge to Sort the Month according to calender like (Feb, Mar, April), which is not working correctly.

Please assist me on this
Capture3.PNG

Thank you

joaoribeiro
Impactful Individual
Impactful Individual

Hi @harirao ,

 

In order to have proper sorting for non numeric values, you can use other column as base. In this case that you are using a month-year column, you can follow the steps below:

  1. Create another column in your Date table for STARTOFMONTH(date)
  2. Select the month-year column  > Sort by Column > Start of Month
  3. After that, the sorting on the visual will follow the same sorting of the date.

You need to create the start of month column, because the "Sort by Column" option will only work if you have unique matches between the two columns, so the "date" column would not work, because there are multiple dates for the same month.

 

joaoribeiro_0-1681292561744.png

 

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️or giving it a kudoe 👍

Thanks!

Best regards,
Joao Ribeiro

Arul
Super User
Super User

@harirao ,

try the following steps.

1. Create a calculated table for months and then total to be shown in the visual,

Months = 
UNION(
    VALUES(
        Table[Month Name]),
        ROW("Column1","Total")
)

Arul_0-1680606066566.png

2. Create a incative relationship between newly created table and the existing table with Month name as a common key between the tables,

Arul_1-1680606147591.png

3. Write the below measure,

Sales Total Measure = 
VAR _selected = SELECTEDVALUE(New Table[Month Name])
VAR _result = IF(
    _selected = "Total",CALCULATE(
        SUM(Table[ Sales]),
        ALLSELECTED(New Table[Month Name]),
        USERELATIONSHIP(Table[Month Name],New Table[Month Name])),
    CALCULATE(
        SUM(
            Table[ Sales]),
            Table[Month Name] = _selected)
)
RETURN _result

4. Use the newly created month names and measure in the visual,

Arul_2-1680606440737.png

Thanks,

Arul

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


joaoribeiro
Impactful Individual
Impactful Individual

Hi @harirao, I believe this video can help you achieve your objective - I tested it myself and it worked:

https://www.youtube.com/watch?v=Tbvi7FaybQ8

 

 

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️or giving it a kudoe 👍

Thanks!

Best regards,
João Ribeiro
Senior BI Consultant

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.