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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
gustavoluis
Regular Visitor

insert grand total in chart

Dears,

i need help please.

 

I have the graph, which is the result of counting open and answered calls per week.

cap 1.png

but at the end I would like to add the grand total with the sum of the selected weeks.
example week 23,24,25,26,27 in excel below:

cap2 excel.png

 

I already followed the steps in this link
https://community.powerbi.com/t5/Desktop/Grand-Total-in-Bar-Chart/m-p/612631

but I couldn't solve the measure.

gustavoluis_0-1658352548671.png

@v-jiascu-msft 

 

 

 

 

1 ACCEPTED SOLUTION

Hi  @gustavoluis ,

 

I originally proposed a disconnected table but after checking on your pbix, I've decided to skip that. I've also modified the formula for the calculated table to account for the week column being a number while "Total" is a text string. Please refer to this pbix - https://drive.google.com/file/d/14CXYQUEz94fIZStO1TUk7j9mNGJ8seYL/view?usp=sharing 

danextian_0-1658447211565.png

 

 










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

4 REPLIES 4
v-henryk-mstf
Community Support
Community Support

Hi @gustavoluis ,

 

Whether the advice given by @danextian  has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.


Looking forward to your feedback.


Best Regards,
Henry

danextian
Super User
Super User

Hi @gustavoluis ,

 

For this, you would have to make use a disconnected (no relationship with Facts/Dimension tables) table that contains all the unique items in a column (week number, etc) plus another row for Total and use that column in a visual.

 

Sample calculated table to create a disconnected table. 

Categories with total = 
VAR __CAT =
    ADDCOLUMNS ( DISTINCT ( Data[Category] ), "Sort", BLANK () )
VAR __TOTAL =
    ROW ( "Category", "Total", "Sort", 10 )
    //Sort column to be used to sort the Category column by where Total is the last one in ascending order. The rest are sorted alphabetically.
RETURN
    UNION ( __CAT, __TOTAL )

 

Sample measure to include the total.

Sum of Value with total = 
VAR __CAT =
    SELECTEDVALUE ( 'Categories with total'[Category] )
VAR __TOTAL =
    CALCULATE ( [Sum of Value], ALLSELECTED ( Data[Category] ) )
RETURN
    IF (
        __CAT = "Total",
        __TOTAL,
        CALCULATE (
            [Sum of Value],
            Data[Category] = SELECTEDVALUE ( 'Categories with total'[Category] )
        )
    )

 

sample result

danextian_0-1658358708874.png

 

sample pbix

https://drive.google.com/file/d/1oUR5D1YftbCs8gDLDnxYq_QjYJmKhqhM/view?usp=sharing 










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

thanks  

 

but I couldn't do it.

how do you make the x axis of the graph be the week of the year
and grand total being the sum of the selected weeks,

can you help me @danextian 

 

my pbix
https://drive.google.com/file/d/1mXzoAizBuwGrWdTs0EPSEgChM_rtKRb9/view?usp=sharing

 

Hi  @gustavoluis ,

 

I originally proposed a disconnected table but after checking on your pbix, I've decided to skip that. I've also modified the formula for the calculated table to account for the week column being a number while "Total" is a text string. Please refer to this pbix - https://drive.google.com/file/d/14CXYQUEz94fIZStO1TUk7j9mNGJ8seYL/view?usp=sharing 

danextian_0-1658447211565.png

 

 










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.