Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Previous Fiscal Quarter value

Hi,    I need help adding a column. I have the below columns and need to add a new column that will show the Previous Quarter Value.    I do not have date or month columns in the dataset.    ...
  • ryan_mayu's avatar
    5 years ago

    Anonymous 

    is this what you want?

    Column = 
    VAR previous=maxx(FILTER('Table (3)','Table (3)'[Fiscalyear]=EARLIER('Table (3)'[Fiscalyear])&&'Table (3)'[fiscalquarter]=EARLIER('Table (3)'[fiscalquarter])-1),'Table (3)'[currentquartervalue])
    VAR previous2=maxx(FILTER('Table (3)','Table (3)'[Fiscalyear]=EARLIER('Table (3)'[Fiscalyear])-1&&'Table (3)'[fiscalquarter]=4),'Table (3)'[currentquartervalue])
    return if('Table (3)'[fiscalquarter]=1,previous2,previous)+0

  • Jihwan_Kim's avatar
    5 years ago

    Hi, Anonymous 

    Please try the below.

     

     

    Previous Q Value CC =
    VAR currentyear = 'Table'[Fiscal Year]
    VAR currentquarter = 'Table'[Fiscal Quarter]
    RETURN
    IF (
    currentquarter <> 1,
    CALCULATE (
    SUM ( 'Table'[Current Quarter value] ),
    FILTER (
    'Table',
    'Table'[Fiscal Year] = currentyear
    && 'Table'[Fiscal Quarter] = currentquarter - 1
    )
    ),
    CALCULATE (
    SUM ( 'Table'[Current Quarter value] ),
    FILTER (
    'Table',
    'Table'[Fiscal Year] = currentyear - 1
    && 'Table'[Fiscal Quarter] = 4
    )
    )
    )

     

     

    Hi, My name is Jihwan Kim.

     

    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

     

    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM