Forum Discussion

PBI_User1's avatar
PBI_User1
New Member
8 years ago
Solved

Measure doesn't work as expected

Hi, I'm trying to create a Measure to do an incremental sum.

Cost running total in Date =
CALCULATE(
SUM('JobDocs'[Cost]);
FILTER(
ALLSELECTED('JobDocs'[Date]);
ISONORAFTER('JobDocs'[Date]; MAX('JobDocs'[Date]); DESC)
)
)


Somebody can help me?

Thanks


 

  • Hi PBI_User1,

     

    Try this formula please.

     

    Cost running total in Date =
    CALCULATE (
        SUM ( 'JobDocs'[Cost] );
        FILTER ( ALL ( 'JobDocs' ); 'JobDocs'[Date] <= MAX ( 'JobDocs'[Date] ) )
    )
    

    Best Regards,

    Dale

     

3 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Microsoft Employee

    Hi PBI_User1,

     

    Try this formula please.

     

    Cost running total in Date =
    CALCULATE (
        SUM ( 'JobDocs'[Cost] );
        FILTER ( ALL ( 'JobDocs' ); 'JobDocs'[Date] <= MAX ( 'JobDocs'[Date] ) )
    )
    

    Best Regards,

    Dale

     

  • Hi,

     

    Try this measure

     

    =CALCULATE(SUM('JobDocs'[Cost]),DATESYTD(Calendar[Date],"31/12/"))

     

    Here are the assumptions:

     

    1. You have a calendar Table with Month and Year columns
    2. There is a relationship from the Data column of the JobsDocs Table to the Date column of the Calendar Table
    3. In your visual, you will drag Year and Month from the Calendar Table.

    Hope this helps.