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
ak77
Helper V
Helper V

Sub Total calculation Help

Hi All,

 

Please help for the below requirement for matrix Viz. I have the below Main Matrix table.. The user wants the MAIN TOTAL value to be only the sum of values where FundCert value is blank.. in this below example 39678 and hide the Fundcert values displayed in FundCert level. 

 

to summarize...39678  should be the MAIN TOTAL and blank values  and its total  for FundCert Columns should be hidden. Is this possible?. Please help. sample PBIX is shared in the below location 

https://drive.google.com/file/d/1evTzmkRSjrX4XtidikRPh9fi1NcjXXI6/view?usp=sharing

 

ak77_0-1694032041116.png

 

2 ACCEPTED SOLUTIONS
parry2k
Super User
Super User

@ak77 try this measure:

 

Sum Value = SUM ( Sheet1[Values] )

Sum for Display = 
 SWITCH ( 
    TRUE (),
    HASONEVALUE ( Sheet1[Classification] ), CALCULATE ( [Sum Value], KEEPFILTERS ( NOT ISBLANK ( Sheet1[Fund Cert] ) ) ),
    CALCULATE ( [Sum Value], ISBLANK ( Sheet1[Classification] ) )
    
)

 

parry2k_0-1694036168133.png

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

parry2k
Super User
Super User

@ak77 the reason it is not working, value in the columns is not blank it is a string with no value, these are two different things:

 

here is the updated measure:

 

Sum Value 1 for Display = 
 SWITCH ( 
    TRUE (),
    HASONEVALUE ( Earningssample[Category_Classification] ), CALCULATE ( [Sum Value1], KEEPFILTERS ( COALESCE ( Earningssample[Category], "" ) <> "" ) ),
    CALCULATE ( [Sum Value1], COALESCE ( Earningssample[Category], "" ) = "" ) 
   )
   
    

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

5 REPLIES 5
ak77
Helper V
Helper V

Thanks a lot @parry2k .. its working now

parry2k
Super User
Super User

@ak77 the reason it is not working, value in the columns is not blank it is a string with no value, these are two different things:

 

here is the updated measure:

 

Sum Value 1 for Display = 
 SWITCH ( 
    TRUE (),
    HASONEVALUE ( Earningssample[Category_Classification] ), CALCULATE ( [Sum Value1], KEEPFILTERS ( COALESCE ( Earningssample[Category], "" ) <> "" ) ),
    CALCULATE ( [Sum Value1], COALESCE ( Earningssample[Category], "" ) = "" ) 
   )
   
    

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

ak77
Helper V
Helper V

Thanks @parry2k , wil check and get back to u

parry2k
Super User
Super User

@ak77 try this measure:

 

Sum Value = SUM ( Sheet1[Values] )

Sum for Display = 
 SWITCH ( 
    TRUE (),
    HASONEVALUE ( Sheet1[Classification] ), CALCULATE ( [Sum Value], KEEPFILTERS ( NOT ISBLANK ( Sheet1[Fund Cert] ) ) ),
    CALCULATE ( [Sum Value], ISBLANK ( Sheet1[Classification] ) )
    
)

 

parry2k_0-1694036168133.png

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k , Thanks again for providing measure. it did worked for the sample PBIX i provided yesterday but when i tried the same measure  with the original dataset the main total is displayed blank. Can you please help. i have attached the pbix for reference . Thanks again

 

Sum Value1 = SUM ( Earningssample[Value1])
 
Sum Value1 for Display =
 SWITCH (
    TRUE (),
    HASONEVALUE ( Earningssample[Category_Classification] ), CALCULATE ( [Sum Value1], KEEPFILTERS ( NOT ISBLANK ( Earningssample[Category] ) ) ),
    CALCULATE ( [Sum Value1], ISBLANK ( Earningssample[Category_Classification] )) )

 

ak77_0-1694128358520.png

https://drive.google.com/file/d/1uRqkCd5TEhMVqi4eTdJDAEDKCfyVnDbv/view?usp=sharing

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.