Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

measures as a value in matrix


Hi,

I'm facing an issue when i'm trying to pass a measure as a value in a matrix.

My data is in this format-

 
 

I have to show only B and E in my matrix and "X" which is the sum of D and E.

My desired output is-desired output

I tried creating a measure X, which is the sum of measure D and E.

{

D=

var a = CALCULATE(

SUM('Table1'[Value]),

FILTER('Table1','Table1'[Account]="D"))

 

var b = CALCULATE(SUM('Table1'[Value]),

FILTER('Table1','Table1'[Year]=SELECTEDVALUE('Table1'[Year]) && 'Table1'[Account]="D"))

return

IF(SELECTEDVALUE('Table1'[Comparison])="CoC",a,IF(SELECTEDVALUE('Table1'[Comparison])="YoY",b))

E=

var a = CALCULATE(

SUM('Table1'[Value]),

FILTER('Table1','Table1'[Account]="E"))

 

var b = CALCULATE(SUM('Table1'[Value]),

FILTER('Table1','Table1'[Year]=SELECTEDVALUE('Table1'[Year]) && 'Table1'[Account]="E"))

return

IF(SELECTEDVALUE('Table1'[Comparison])="CoC",a,IF(SELECTEDVALUE('Table1'[Comparison])="YoY",b))

 

X=[D]+[E]

}

 

when i'm trying to pass this measure in Value section of the matrix, it's not showing anything

Matrix data setting:

Rows- Account

Columns- Quarter

Values- X

 

It's giving a blank matrix as an output. What is the alternative way to show this?

 

Please note- Data is huge and this is just the sample data to depict the data outline.

  • Anonymous's avatar
    Anonymous
    6 years ago

    v-yuta-msft  No, there's no conflict there. The measure is working fine and when i'm using the measure in the Values section in the matrix, it's not showing any value. There's no error. It's just that no values are being displayed.

6 Replies

  • PaulDBrown's avatar
    PaulDBrown
    Icon for Community Champion rankCommunity Champion

    Anonymous 

     

    Sorry, did you actually include a sample of your data structure? or is it in the structure as seen in you screenshot?

    • Anonymous's avatar
      Anonymous
      Not applicable

      PaulDBrown  Yes, I have attached a sample data structure similar to the original one. I can't share the original one due to privacy policies.

       

      The desired output which i want is-

       

      A (which is directly coming from Data column Account)

      C (which is directly coming from Data column Account)

      X (measure which shows the sum of D and E)

  • v-yuta-msft's avatar
    v-yuta-msft
    Icon for Community Support rankCommunity Support

    Anonymous ,

     

    Please check if there's any conflict between the conditions in your measure:

    'Table1'[Year]=SELECTEDVALUE('Table1'[Year])
    
    'Table1'[Account]="D"
    
    'Table1'[Account]="E"
    
    'Table1'[Comparison])="CoC"
    
    'Table1'[Comparison])="YoY"

    Community Support Team _ Jimmy Tao

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      v-yuta-msft  No, there's no conflict there. The measure is working fine and when i'm using the measure in the Values section in the matrix, it's not showing any value. There's no error. It's just that no values are being displayed.

      • v-yuta-msft's avatar
        v-yuta-msft
        Icon for Community Support rankCommunity Support

        Anonymous ,

         

        Could you please share a simple sample table(need raw data, not the matrix visual) so that I could do further test?

         

        Regards,

        Jimmy Tao