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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
wilsjay
Regular Visitor

How to show/hide the table matrix subtotals line based on multiple values being selected in a slicer

I have a basic report using a table matrix visual with several filters and slicers.  One of my slicers is a multi select.  When only one value is selected I want to show the totals line on the visual, when multiple values are selected in the slicer I want to hide the totals line.  What is the best way to implement this?  

 

I can create my own measure for each column with a DAX formula like the following:

ShowValueOrBlank =
VAR SelectedCount = COUNTROWS(VALUES('Table'[SalesID]))
RETURN
IF(
HASONEVALUE('Table'[SalesID]),
SUM('Table'[pr_hrs]),
BLANK()
)

Then check for HASONEVALUE to display.

 

Is there a better way to do this?  Then how to implement getting those new measures in the visual.  For instance, a Union?  Doesn't seem like the best way.

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

Hi @wilsjay
Thank you for reaching out to the Microsoft fabric community forum. Thank you @lbendlin, for your inputs on this issue.

After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it.    

Power BI does not currently support conditionally showing/hiding subtotals in matrix visuals through a built-in feature. The only way to manipulate what’s visible is by controlling what data is displayed, which we can handle with DAX measures.


I am also including .pbix file for your better understanding, please have a look into it:

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

Thank you for using Microsoft Community Forum.

View solution in original post

5 REPLIES 5
v-kpoloju-msft
Community Support
Community Support

Hi @wilsjay
Thank you for reaching out to the Microsoft fabric community forum. Thank you @lbendlin, for your inputs on this issue.

After thoroughly reviewing the details you provided, I was able to reproduce the scenario, and it worked on my end. I have used it as sample data on my end and successfully implemented it.    

Power BI does not currently support conditionally showing/hiding subtotals in matrix visuals through a built-in feature. The only way to manipulate what’s visible is by controlling what data is displayed, which we can handle with DAX measures.


I am also including .pbix file for your better understanding, please have a look into it:

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

Thank you for using Microsoft Community Forum.

Hi @wilsjay,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

Hi @wilsjay,


I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

Hi @wilsjay,


I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.


Thank you.

lbendlin
Super User
Super User

you cannot programmatically show/hide subtotals.  That can only be done in the UI.

 

Which is kinda weird as the rendering code would support it. If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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