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
byWing
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):

byWing_0-1680774712369.png

Desired outcome when put into a matrix/ table:

byWing_1-1680774748618.png

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

byWing_2-1680774805770.png

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

 

1 REPLY 1
v-cgao-msft
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.]

vcgaomsft_0-1681190649970.png

vcgaomsft_1-1681190693101.png

Then drag these fields into the table.

vcgaomsft_2-1681190784075.png

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

vcgaomsft_3-1681190822339.png

 

If Total is not correct, try this measure.

 

Measure = 
SUMX(
    SUMMARIZE(
        'Table',
        'Table'[Site],
        "bugt",[@Budget]
    ),
    [bugt]
)

 

 

Best Regards,
Gao

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

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.