Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Matrix/Table visual question

Hi everyone,

 

I need your help to figure out how to create a matrix or table as shown below:

 

"Target" is a measure in my case and if just include it to my martix as a value, it shows as below:

 

Is it possible to achieve "Target" as a single column in front ( as shown in first/top piture)?

  • Hi Anonymous ,

     

    Please create the new table and inactive relationship:

     

    MatrixColumns = 
    UNION ( VALUES ( 'Table'[Date] ), { "Target" } )

      

     

    Then use the measure:

     

    Measure = 
    IF (
        MAX ( MatrixColumns[Date] ) = "Target",
        [Target],
        CALCULATE (
            SUM ( 'Table'[Value] ),
            USERELATIONSHIP ( 'Table'[Date], MatrixColumns[Date] )
        )
    )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • v-kkf-msft's avatar
    v-kkf-msft
    Community Support

    Hi Anonymous ,

     

    Please create the new table and inactive relationship:

     

    MatrixColumns = 
    UNION ( VALUES ( 'Table'[Date] ), { "Target" } )

      

     

    Then use the measure:

     

    Measure = 
    IF (
        MAX ( MatrixColumns[Date] ) = "Target",
        [Target],
        CALCULATE (
            SUM ( 'Table'[Value] ),
            USERELATIONSHIP ( 'Table'[Date], MatrixColumns[Date] )
        )
    )

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.