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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Frequent Visitor

How to calculate TOTAL for table with slicer?

Hi All,


I understand calculating the TOTAL in PowerBi is always a challenge. But being new to DAX doesn't help. 

I have read so many posts but I am not getting anywhere. I think it's something with SUMX but I have tried many different versions, and it still didn't work. =(

So will really need some help with this please:


Here is what I have in a database (simplifed version):


Desired outcome when put into a matrix/ table:


Desired outcome when I use my slicer to filter by sites on the matrix/ table:


What kind of DAX do I write please?
Thank you so much in advance!~


Community Support
Community Support

Hi @byWing ,


Power BI will automatically merge the categories. To display them this way, you need to add an [index] column in the PowerQuery Editor.]



Then drag these fields into the table.


Finally, adjust the font color of the [index] column to match the background color.



If Total is not correct, try this measure.


Measure = 



Best Regards,

Community Support Team


If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.