Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago

Tricky DAX Formula

I have this table:

 

I am looking to build a formula that will look back 2 months, gather the sum of revenue for that month, and multiply it by 12 to get my Projected Sum. So hypothetically, the formula for March would look like:

(Sum of January Revenue) * 12

 

Once April is here, it would then be

(Sum of February Revenue) * 12

 

etc. etc.

 

This way if the formula looks back and returns no data, it tells us that specific company has recently been terminated since there was no projected sum reported.

 

Is there a way to do something like that? Thanks!

6 Replies

  • Hi  Anonymous,

     

    You should use something like this:

     

    Projected Sum =
    CALCULATE (
        TOTALYTD (
            SUM ( Table[Revenue_Amount_c] );
            DATEADD ( Table[Revenue_Date_C]; -2; MONTH )
        )
    )
        * 12

     

    Regards,

    MFelix

    • Anonymous's avatar
      Anonymous
      Not applicable

      MFelix This displays when trying to add it to a table with other data:

      • MFelix's avatar
        MFelix
        Super User
        Do you have a calendar table that relates with revenue date?