cancel
Showing results 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

## 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)

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:

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:

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!

Proud to be a Super User!

Announcements

#### 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.

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

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