Forum Discussion

UKNSI-Powerbi's avatar
UKNSI-Powerbi
Frequent Visitor
4 years ago
Solved

PowerBi - Running totals

Hi everyone,   I need to perform a running total on a pivot table based on calendar.   Year1 Net is calculated with the following formula 100+10-5=105 Year 2 because a running total use Ye...
  • Jihwan_Kim's avatar
    Jihwan_Kim
    4 years ago

    Hi,

    Thank you for your message.

    Did you open the file that I attached?

    Or, are you using different one and using the meaasure that I created?

     

    I am seeing the below screenshot.

     

     

    For checking purpose, try the below.

    Net measure v2: = 
    VAR _initialstock =
         MAX ( Sheet1[Initial Stock] )
    VAR _newtablesupplydemand =
        SUMX (
            FILTER (
                ALL ( Sheet1 ),
                Sheet1[Item] = MAX ( Sheet1[Item] )
                    && Sheet1[Week YYWW] <= MAX ( Sheet1[Week YYWW] )
            ),
            Sheet1[Supply] - Sheet1[Demand]
        )
    RETURN
        _initialstock + _newtablesupplydemand