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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
arobinson
Frequent Visitor

Table Total

I am working with the below formula, but need to show the sum of these on the matrix that is pulling these in. 
 
BBT Daily Supervisor Goal =
 
VAR _Super = SELECTEDVALUE(User_Information[Supervisor])
VAR _OpsMan = SELECTEDVALUE(User_Information[Operations Manager])

 

    Return
 
SWITCH(
        True(),
  _Super = "Name 1", 2927,
    _Super = "Name 2", 1919,
    _Super = "Name 3", 991,
    _Super = "Name 4", 3770,
    _Super = "Name 5", 3304,
    _Super = "Name 6", 2822,
    _Super = "Name 7", 0,
    _OpsMan = "Name 8", 5837,
    _OpsMan = "Name 9", 12396)
 
arobinson_0-1660234616701.png

 

1 REPLY 1
ValtteriN
Super User
Super User

Hi,

Table totals are always a bit tricky subject. In short I recommend using SUMX in your dax to solve this behaviour. Basically since the SELECTEDVALUE variables return blank for the total row your formula returns blank.

Example:

ValtteriN_0-1660249222294.png

Measure 22 (a measure without any tricks):

var letter = SELECTEDVALUE('Table (11)'[Column1]) return
SWITCH(TRUE(),
letter="A",1,
letter="B",1,
letter="C",1)

Measure 23 (total logic correction):

IF(SELECTEDVALUE('Table (11)'[Column1])=BLANK(),
SUMX(ALL('Table (11)'),[Measure 22]),[Measure 22])
End result:
ValtteriN_1-1660249647576.png

 







Here is an excellent explanation byt SQLBI on what is going on here: https://www.sqlbi.com/articles/obtaining-accurate-totals-in-dax/


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 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.

May 2025 Monthly Update

Fabric Community Update - May 2025

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