Forum Discussion

LuisMLRossa's avatar
LuisMLRossa
Frequent Visitor
4 years ago
Solved

Matrix Visual :: "Ghost" numbers not adding up

Hi All,

 

Kindly request your help about this issue.

 

In short:

Some numbers in a matrix visual are invisible to totals, sub-totals, etc.

 

In detail:

I have a matrix visual and in the rows there are two levels, level 1 and level2.

The amount, in the value section, is the sum of the sales.

 

The base table is:

 

All "Level2" rows have a value of 1.

Level2 in (2,7,9,12,14) is null.

 

I created a measure, called "NewAmount" to mantain the original value of 1 and, on the other hand, "hardcode" a number in the null positions:

 

----------------------------------------

NewAmount =
VAR Result =
SWITCH (
TRUE (),
SELECTEDVALUE ( 'Sales'[Level2]) = 2,20,
SELECTEDVALUE ( 'Sales'[Level2]) = 7,70,
SELECTEDVALUE ( 'Sales'[Level2]) = 9,90,
SELECTEDVALUE ( 'Sales'[Level2]) = 12,120,
SELECTEDVALUE ( 'Sales'[Level2]) = 14,140,
SUM ( Sales[Amount] )
)

RETURN
Result

-------------------------------------------------------------

The result is the following:

 

So far, so good ...

 

The problem is that the "hardcoded" numbers are invisible from the point of view of the matrix total.

Yes, I can see them, but the totals and row aggregates do not see these numbers.

 

Evidence 1

Evidence 2

 

In this last case, only the level 1 is visible and I wanted that the first sum up would be 22 and not 2.

 

Thanks in advance for your time.

 

 

 

 

 

2 Replies

  • LuisMLRossa , Try a measure like

     

    Sumx(summarize(Table, Table[Level1], Table[Level2], "_1",Result),[_1])

    • LuisMLRossa's avatar
      LuisMLRossa
      Frequent Visitor

      Hi amitchandak,

       

      Good morning to you.

       

      I tried what you suggested and .... now I have the results I needed.

       

      Thank you.

       

      More Detail:

       

      The dax formula I made was:

      NewAmount3 = sumx(SUMMARIZE(Sales,Sales[Level1],Sales[Level2],Sales[Amount]),[NewAmount])
       
      But I tried with another mesaure and it worked:
      NewAmount2 = sumx(values(Sales[Level2]),[NewAmount])
       
      I think the base concept is the same.