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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
KumarC
Frequent Visitor

Total column using a measure in a matrix to be displayed as grand total and not as subtotals

Hello, I have started using Power BI literally 3 days back, learning with forums and youtube videos. Please bear with me if this question had already been answered somewhere, I was not able to arrive on the solution after searching for it.

 

Using a Matrix to display revenue generated, with a filter 'Relative Date' displaying the last 5 days numbers. This matrix will be dynamic with each day data upload and refresh.

 

What I am trying to achieve is:

Matrix will show the last 5 days individual numbers per row

A Total column displaying the entire revenue so far till that date (basically revenue to date)

 

I was able to use a measure to get a calculated column and display it in the matrix. But it is actually showing as Sub Totals for each column. I have checked and played around with all the settings but nothing impacted. I am breaking my head with this and it will be really helpful to have this sorted out, since there will be multiple other pages with different filters and categories with similar display functionality.

 

Current view of the matrix:

KumarC_0-1671220455146.png

Desired result of the matrix:

KumarC_1-1671220847149.png

 

2 ACCEPTED SOLUTIONS
PaulDBrown
Community Champion
Community Champion

There are a couple of ways  of solving this that I'm aware of. 

1. "Hide" the unwanted measure under each date. To do this you will need to turn off word wrap under column headers in the formatting pane, select the right boundary of each rogue column  and drag it left to hide it. Repeat with each unwanted date  column. The caveat is that need maintenance.

2. Create a custom matrix layout. This involves creating a custom table with the column layout and some DAX. You can see an example in this blog post:

https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1... 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

grandtotal
Resolver III
Resolver III

well, first you need a Date table which is marked as date table.

grandtotal_0-1671232191109.png

you can create one by CALENDAERAUTO() function.

 

Then you set the relationship:

grandtotal_1-1671232270741.png

 

For the running total you can use this measure:

Measure running total in Date = 
CALCULATE(
    SUM('Table'[amount]),
    FILTER(
        ALLSELECTED('Date'[Date]),
        ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC)
    )
)

 

Then "hide" your columns as mentioned by @PaulDBrown 

 

 

View solution in original post

6 REPLIES 6
grandtotal
Resolver III
Resolver III

well, first you need a Date table which is marked as date table.

grandtotal_0-1671232191109.png

you can create one by CALENDAERAUTO() function.

 

Then you set the relationship:

grandtotal_1-1671232270741.png

 

For the running total you can use this measure:

Measure running total in Date = 
CALCULATE(
    SUM('Table'[amount]),
    FILTER(
        ALLSELECTED('Date'[Date]),
        ISONORAFTER('Date'[Date], MAX('Date'[Date]), DESC)
    )
)

 

Then "hide" your columns as mentioned by @PaulDBrown 

 

 

To be honest, adding this measure was giving me wrong calculation but its on me, I will play around and learn how it works 🙂 And, I am not entirely sure how this Date Table will help me in the future, so parked it aside for the moment and 'circle back after holidays' 😉  Thank you for your input!

PaulDBrown
Community Champion
Community Champion

There are a couple of ways  of solving this that I'm aware of. 

1. "Hide" the unwanted measure under each date. To do this you will need to turn off word wrap under column headers in the formatting pane, select the right boundary of each rogue column  and drag it left to hide it. Repeat with each unwanted date  column. The caveat is that need maintenance.

2. Create a custom matrix layout. This involves creating a custom table with the column layout and some DAX. You can see an example in this blog post:

https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1... 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hiding the column, its that simple isnt it, smh 😄 thank you very much for the tip. I am continuing to use the measure I created and hide the columns, it worked perfectly! Yes, acknowledging the cutom matrix layout, I will definitely try to learn from the link and have something ready for the long run. Thank you for the solution!

grandtotal
Resolver III
Resolver III

can you send us a sample of your data and model?

with a proper data modell you can easily achive this with CALCULATE and time intelligence functions:

https://learn.microsoft.com/en-us/dax/time-intelligence-functions-dax

https://we.tl/t-clEEOrFa16

sample dataset in csv format attached in this link. i have included only the columns that will be used for the reports, excluded everything else just for saving the file size and its irrelevant as well.

 

datamodel in this picture. it is a simple dataset with a straightforward pivot like function, except the dataset becomes huge each day without about 200k rows atleast. hence i have started using mysql as database to store data and feed it to powerbi for genering the reports.

KumarC_0-1671228371794.png

 

hope this helps!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.