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
jhurst
Frequent Visitor

How to have both total and average

I'm a Power BI newbie & hope someone can help. I have a table visualization (I've also tried matrix as well) & want to have BOTH a Total AND Average at the bottom (like the picture below).  I've gotten one or the other but not both at the same time.  Is this possible?

powerbi-totalaverage.PNG

1 ACCEPTED SOLUTION

Actually, building on my previous reply, you can put a line break in a measure with a shift + enter inside a text string.

jdbuchanan71_0-1595520283337.png

Then you get something like this which is close

jdbuchanan71_1-1595520327616.png

You do have to turn on Word wrap for the values field as well in order for the line break to show up.

 

View solution in original post

11 REPLIES 11
jdbuchanan71
Super User
Super User

@jhurst 

You could do something like this where you check if you are on a reqular row (a single date) and if not return both the total and the average.

COUNT = 
VAR _avg = AVERAGEX ( VALUES ( 'Date'[Date] ), [Count Measure] )
VAR _count = [Count Measure]
RETURN
    IF (
        HASONEVALUE ( 'Date'[Date] ),
        _count,
        FORMAT ( _count, "#,#" ) & " (" & FORMAT ( _avg, "#,#" & ")" )
    )

jdbuchanan71_1-1595519917916.png

 

Actually, building on my previous reply, you can put a line break in a measure with a shift + enter inside a text string.

jdbuchanan71_0-1595520283337.png

Then you get something like this which is close

jdbuchanan71_1-1595520327616.png

You do have to turn on Word wrap for the values field as well in order for the line break to show up.

 

@ jdbuchanan71

So this code is a measure, right? (I did say I was new to this)

When I enter it, then adjust for the names of my table & fields I get the message "The name 'Count' is already used for a column name on table 'Query1'.  Choose a different name."  Then when I rename it, it ends up adding a new column instead of just putting the total & average on the bottom of the existing column.

powerbi-totalaverage3.PNG

Right, you can take your first column out though and only show the new one.

So if I have multiple columns & wanted the total & average for each of them, I'd need to create multiple measures - one for each of them?

That's correct.  

@ jdbuchanan71

Maybe.  Is there any way to change the row name to "Total (Average)"?  Otherwise people wouldn't necessary know what that 2nd number was.

Yes, you can change the total label in the formatting:

jdbuchanan71_0-1595520559075.png

 

amitchandak
Super User
Super User

@jhurst , I doubt you can have an additional total row. You can have either avg or total.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
camargos88
Community Champion
Community Champion

Hi @jhurst ,

 

I haven't seen a visual like this. However you can drag the same column again to the visual and change the aggregation in the fields pane.



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

Proud to be a Super User!



Unfortunately, it added a new column with the same data; not exactly what I was looking for.

powerbi-totalaverage2.PNG

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.