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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to show Sum of required attribute element values as subtotal?

Hi team,

I have 3 attribute elements(which is coming from only one column)  on columns and 3 measure on rows in matrix , here Iwhen I enable subtotal row wise its calculating all 3 attribute element values but i need to calculate only 2 attribute elements as subtotal?

 

Please help me.

5 REPLIES 5
dax
Community Support
Community Support

Hi @Anonymous , 

You said you want to re-define the row subtotal, so I think your attributes should be in Row instead of in Column. Below is my sample, you could refer to it for details. If this is not what you want , please correct me and inform me more details(your sample and your expected output)

Best Regards,
Zoe Zhi

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

Anonymous
Not applicable

Hi Sir,

 

Thanks for your reply.

 

Subtotal_Screenshot.png

Please find the attached Screenshot my sample report. Here i wanted to calculate total as shown in the Screenshot.

But It should calculate  Chairs and Fans for each measure(Profit and sales).

Expected Calculation should be :

Profit Total = Chairs 10000+ Fans 12000 = 22000.

Sales Total = (Chairs 50000 + Fans 70000=  12000.

 

 

 

Thank You!!

 

dax
Community Support
Community Support

Hi @Anonymous , 

You could refer to my sample for details.

Measure 5 = IF(HASONEVALUE(T1[Attributes]), SUM(T1[amount]), CALCULATE(SUM(T1[amount]), FILTER(T1, T1[Attributes]<>"C")))

Best Regards,
Zoe Zhi

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

Anonymous
Not applicable

Hi Sir,

Thanks for the solution which you have provided.

Here you have taken Profit and Sales as a attribute values and the provided DAX 100% working. 

Solution_ss.png

But in my scenorio data is like below

myss.png

here iam facing littele difficut to achieve the rquirement.

 

I would be thankfull if you can help me on this.

 

Thanks!

Suresh.

 

 

 

 
amitchandak
Super User
Super User

@Anonymous , this should help

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

 

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

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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