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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Custom grand total in Matrix

Hello All,

 

I am trying to create a custom grand total in the Matrix visualization but I am not able to achieve it, is there a way to get it.

Below is the  example.

 trans
a10
b20
c30
total12

 

Here I am trying to get sum(trans)/5 in the grand total, but in matrix by default I'm getting 60. Can some please help me on this request.

 

Thanks for all your support.

1 ACCEPTED SOLUTION
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can do like this:

Measure = 
IF(
    HASONEVALUE('Table'[Trans]),
    SUM('Table'[Trans]),
    SUM('Table'[Trans])/5
)

l1.PNG

 

Best regards,
Lionel Chen

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

View solution in original post

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

You can do like this:

Measure = 
IF(
    HASONEVALUE('Table'[Trans]),
    SUM('Table'[Trans]),
    SUM('Table'[Trans])/5
)

l1.PNG

 

Best regards,
Lionel Chen

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

amitchandak
Super User
Super User

@Anonymous , you have to use isinsope or isfiltered to do that

 

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

 

if( isfiltered(Table[Commodities]), [formula ],[formula ]/5)

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.