Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Previous Quarter

 

How can I write a DAX formula to calculate the sum of the previous quarter revenue and multiply that total by 4?

  • Anonymous's avatar
    Anonymous
    8 years ago

    Hi Anonymous,

     

    Try create a DAX column with this formula:

    previousquarter =
    CALCULATE (
        SUM ( 'Table'[Revenue] );
        ALL ( 'Table' );
        PREVIOUSQUARTER ( 'Table'[Revenue Date] )
    )
        * 4

    Regards.

    Note: If you get a syntax error it's probably because of the semicolons instead of commas, Power BI has the two options to delimit DAX, change semicolons by commas and it should work.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

     

    Try create a DAX column with this formula:

    previousquarter =
    CALCULATE (
        SUM ( 'Table'[Revenue] );
        ALL ( 'Table' );
        PREVIOUSQUARTER ( 'Table'[Revenue Date] )
    )
        * 4

    Regards.

    Note: If you get a syntax error it's probably because of the semicolons instead of commas, Power BI has the two options to delimit DAX, change semicolons by commas and it should work.

    • arvindyadav's avatar
      arvindyadav
      Icon for Post Partisan rankPost Partisan

      Hi Anonymous,

       

      I am getting nothing by using this formula. Can you explain to me why I am getting nothing?

       

      Thanks, 

      Arvind