Total Rows Not Working

So I am curious as to whether there is something about the measure in the matrix that prevents the total rows from working. It gives the numbers just fine on the rows as it should but when it comes to the totals they are blank. I have checked the settings to ensure the totals are toggled on. Is there a battery way to approach the below formula to make the totals work as expected?

The measure is

Anticipated Tuition =

IF(
HASONEVALUE(projections[Projection Category]),
SWITCH(
TRUE(),
VALUES(projections[Projection Category])= “UG Civilian”, ‘Key Measures - Projections’[Projections] * (429 * 3),
VALUES(projections[Projection Category])= “UG Military”, ‘Key Measures - Projections’[Projections] * (250 * 3),
VALUES(projections[Projection Category])= “GR Civilian”, ‘Key Measures - Projections’[Projections] * (714 * 3),
VALUES(projections[Projection Category])= “GR Military”, ‘Key Measures - Projections’[Projections] * (599 * 3)))

the first part of your measure is the answer

IF( HASONEVALUE( projections[Projection Category]) -
the total line is going to return a ‘FALSE’, and you don’t have anything to indicate what to do if it’s false, your SWITCH formula is only handling the ‘TRUE’ response

What do you want the total line to return? a total of each of the above lines?

Hi @jmwdba,

@Heather is correct, there is no evaluation context coming from projections[Projection Category] in the Total row. So you’d need to bring that context back using an iterator to calculate the correct result.

Below some resources to help you fix it. But you can also use the Search option in the upper right corner because there’s a lot of content on this subject available within the forum.


.
I hope this is helpful.

Thats correct. It should be a total of everything above.

I just want it to return the total of the rows that show in the visual.

@Melissa is correct, you definitely want to read the links so you better understand what is going on.

For now, see if this will provide the response you are looking for, without seeing your model, I’m not 100% that this is your solution:

VAR ugCIV = ‘Key Measures - Projections’[Projections] * (429 * 3)
VAR ugMIL = ‘Key Measures - Projections’[Projections] * (250 * 3)
VAR grCIV = ‘Key Measures - Projections’[Projections] * (714 * 3)
VAR grMIL = ‘Key Measures - Projections’[Projections] * (599 * 3)

IF(
HASONEVALUE(projections[Projection Category]),
SWITCH(
TRUE(),
VALUES(projections[Projection Category])= “UG Civilian”, ugCIV,
VALUES(projections[Projection Category])= “UG Military”, ugMIL,
VALUES(projections[Projection Category])= “GR Civilian”, grCIV,
VALUES(projections[Projection Category])= “GR Military”, grMIL),
ugCIV + ugMIL + grCIV + grMIL)
1 Like

Got it. I guess I was having a day. Below is how I completed out the formula and all is well now.

Anticipated Tuition =
VAR UGCIV = ‘Key Measures - Projections’[Projections] * (429 *3)
VAR UGMIL = ‘Key Measures - Projections’[Projections] * (250 * 3)
VAR GRCIV = ‘Key Measures - Projections’[Projections] * (714 * 3)
VAR GRMIL = ‘Key Measures - Projections’[Projections] * (599 * 3)

RETURN
IF(
HASONEVALUE(projections[Projection Category]),
SWITCH(
TRUE(),
VALUES(projections[Projection Category]) = “UG Civilian”, UGCIV,
VALUES(projections[Projection Category]) = “UG Military”, UGMIL,
VALUES(projections[Projection Category]) = “GR Civilian”, GRCIV,
VALUES(projections[Projection Category]) = “GR Military”, GRMIL),
UGCIV + UGMIL + GRCIV + GRMIL)