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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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