Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Adding Up Down Arrows to matrix/table

Hi

 

I have a number of matrix tables in a report, i'd like to add dynamic arrows to show an increase/decrease based on the current week vs the previous week. 

 

Sample of my matrix: 

 

 

On each row I want to add at the end if there was an increase or decrease for example between week 45 vs week 44. 

Is this a possibility?

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous 

    You can refer to the following solution

    Sample data 

    Week table

    Relationship

     

    1.Create a measure

    Measure =
    VAR _pre =
        CALCULATE (
            SUM ( 'Table'[Value] ),
            'Table (2)'[Week]
                = SELECTEDVALUE ( 'Table (2)'[Week] ) - 1
        )
    RETURN
        SWITCH (
            TRUE (),
            SUM ( 'Table'[Value] ) < _pre, 1,
            SUM ( 'Table'[Value] ) = _pre, 2,
            SUM ( 'Table'[Value] ) >= _pre, 3
        )
    

    2.Then put it to the conditional formatting of the value in the matrix

     

    Output

    Best Regards!

    Yolo Zhu

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

     

2 Replies

  • vanessafvg's avatar
    vanessafvg
    Community Champion

    it is possible.

     

    1. you need a date table
    2. calculate a this weeks measure
    3. calculate the previous weeks value
    4. compare the measures and use conditional formatting to provide how the arrows based on the compare result

     

    sql bi have all the patterns you need i suggest you use  this link, https://www.daxpatterns.com/week-related-calculations/

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    You can refer to the following solution

    Sample data 

    Week table

    Relationship

     

    1.Create a measure

    Measure =
    VAR _pre =
        CALCULATE (
            SUM ( 'Table'[Value] ),
            'Table (2)'[Week]
                = SELECTEDVALUE ( 'Table (2)'[Week] ) - 1
        )
    RETURN
        SWITCH (
            TRUE (),
            SUM ( 'Table'[Value] ) < _pre, 1,
            SUM ( 'Table'[Value] ) = _pre, 2,
            SUM ( 'Table'[Value] ) >= _pre, 3
        )
    

    2.Then put it to the conditional formatting of the value in the matrix

     

    Output

    Best Regards!

    Yolo Zhu

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