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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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