Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
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.
Solved! Go to Solution.
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
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.
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
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
75 | |
73 | |
69 | |
47 | |
41 |
User | Count |
---|---|
63 | |
41 | |
30 | |
28 | |
28 |