Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Need Help: Yearly step-down calculation based on a fixed percentage

Hi, 

 

I'm new to DAX and I need help with coming up with a DAX computation

 

The scenario here is that at the start of each new year from [Period No.] = 8 onwards, I need to compute a degredation.  

 

The first year (ie. [Period No. = 8]), there will be no degredation therefore 100% but in subsequent years, there will be a degredation of 0.7% p.a.  and this degradation will only happen at the start of the year.  

 

Please help on what DAX expression should be written to achieve the results above. 

 

Thanks

 

YearYear. NoPeriod No.Start dateEnd dateDegredation
2018111-Apr-1830-Jun-18 
2018121-Jul-1830-Sep-18 
2018131-Oct-1831-Dec-18 
2019241-Jan-1931-Mar-19 
2019251-Apr-1930-Jun-19 
2019261-Jul-1930-Sep-19 
2019271-Oct-1931-Dec-19 
2020381-Jan-2031-Mar-20100.0%
2020391-Apr-2030-Jun-20100.0%
20203101-Jul-2030-Sep-20100.0%
20203111-Oct-2031-Dec-20100.0%
20214121-Jan-2131-Mar-2199.3%
20214131-Apr-2130-Jun-2199.3%
20214141-Jul-2130-Sep-2199.3%
20214151-Oct-2131-Dec-2199.3%
20225161-Jan-2231-Mar-2298.6%
20225171-Apr-2230-Jun-2298.6%
20225181-Jul-2230-Sep-2298.6%
20225191-Oct-2231-Dec-2298.6%
20236201-Jan-2331-Mar-2397.9%
20236211-Apr-2330-Jun-2397.9%
20236221-Jul-2330-Sep-2397.9%
20236231-Oct-2331-Dec-2397.9%
20247241-Jan-2431-Mar-2497.2%

 

 

 

  • Anonymous 

     

    You may use DAX below to add a calculated column.

    Column =
    VAR p = 'Table'[Period No.] - 8
    RETURN
        IF ( p >= 0, 1 - QUOTIENT ( p, 4 ) * 0.7 / 100 )
    

     

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Probably something like:

     

    Degradation = 
    VAR __period = [Period]
    VAR __degradation = 
        IF([Period] < 8,
            BLANK(),
            INT( (__period - 😎 / 4) * .7
        )
    RETURN 100 - __degradation
    

     

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Community Support

    Anonymous 

     

    You may use DAX below to add a calculated column.

    Column =
    VAR p = 'Table'[Period No.] - 8
    RETURN
        IF ( p >= 0, 1 - QUOTIENT ( p, 4 ) * 0.7 / 100 )