Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

If function -> Else part doesn't work

Hi,

 

I have data from my divisions that I collect quarterly  that are based on our Fiscal Year (starting in April)

FYQuarterNumber of...Number of...Number of...Number of...Number of...Number of...

 

Since I want to do time intelligence (QoQ%), I have create new colum to get a date out of FY & Quarter : 2020 Q1->20200401 -> 2020-04-01.  

What I am trying to achieve here is to remove one year for every quarter except Q4.

 

Adjusted Date =
IF (
    'Report'[Quarter] = "Q4",
    'Report'[Date],
    DATEADD ( 'Report'[Date], -1YEAR )
)

 

Fiscal Year 2020

Expected Output

FYQuarterDateAdjusted Date
2020Q12020-04-012019-04-01
2020Q22020-07-012019-07-01
2020Q32020-10-102019-10-10
2020Q42020-01-012020-01-01

 

My output

FYQuarterDateAdjusted Date
2020Q12020-04-01 
2020Q22020-07-01 
2020Q32020-10-10 
2020Q42020-01-012020-01-01

 

Thank you,

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you! It does work. However, it is weird that it doesn't work with an IF statement. amitchandak