Forum Discussion

gdssiqueira's avatar
gdssiqueira
Helper I
10 years ago
Solved

Subtract values from different rows

Hello,   I'm working on a project and there's something I need your help with. I need to display the difference between two values in different rows. Ideally, I'd need a visual that allowed me to d...
  • Vvelarde's avatar
    Vvelarde
    10 years ago

    Hi gdssiqueira

     

    1. Create a new table summarized:

     

    TableWorkSumm =
    SUMMARIZE (
        TableWork;
        TableWork[Date ];
        TableWork[Category ];
        "Result"IF (
            CALCULATE ( SUM ( TableWork[Value] ); TableWork[Type] = "Purchase" )
                CALCULATE ( SUM ( TableWork[Value] ); TableWork[Type] = "Refund" )
                CALCULATE ( SUM ( TableWork[Value] ); TableWork[Type] = "Purchase" );
            BLANK ();
            CALCULATE ( SUM ( TableWork[Value] ); TableWork[Type] = "Purchase" )
                CALCULATE ( SUM ( TableWork[Value] ); TableWork[Type] = "Refund" )
        )
    )
     
    2. When you use the Column Result; Select Visual Filter to Result to Is not Blank and Applied