Forum Discussion

huzzapac's avatar
huzzapac
Regular Visitor
1 year ago
Solved

YOY%

Hii Everyone!


I need to know what will be the YOY% for the price I have for the table properties with column name Current price. Please Provide me dax for that.

 

Thank you in Advance!

  • Hii huzzapac 

    YoY % Current Price = 
    VAR CurrentYearPrice = SUM('Property Table'[Current_Price])
    VAR PreviousYearPrice = 
        CALCULATE(
            SUM('Property Table'[Current_Price]),
            SAMEPERIODLASTYEAR('Transactional Table'[Transaction_Date])
        )
    RETURN
        IF(
            NOT ISBLANK(PreviousYearPrice),
            DIVIDE(CurrentYearPrice - PreviousYearPrice, PreviousYearPrice, 0),
            BLANK()
        )



    If this helps, I would appreciate your KUDOS!
    Did I answer your question? Mark my post as a solution!

5 Replies

  • Hiii huzzapac 

    YoY % Change =
    VAR CurrentYearPrice =
    CALCULATE(
    SUM(PropertyTable[Current_Price]),
    FILTER(PropertyTable, PropertyTable[Year] = MAX(PropertyTable[Year]))
    )

    VAR PreviousYearPrice =
    CALCULATE(
    SUM(PropertyTable[Current_Price]),
    FILTER(PropertyTable, PropertyTable[Year] = MAX(PropertyTable[Year]) - 1)
    )

    RETURN
    IF(
    NOT ISBLANK(PreviousYearPrice),
    DIVIDE(CurrentYearPrice - PreviousYearPrice, PreviousYearPrice, 0),
    BLANK()
    )



    If this helps, I would appreciate your KUDOS!
    Did I answer your question? Mark my post as a solution!

    • huzzapac's avatar
      huzzapac
      Regular Visitor

      I want it only based on years not based on the property type column I have ploted in table

  • huzzapac's avatar
    huzzapac
    Regular Visitor

    I want it only based on years not based on the property type column I have ploted in table

    • Khushidesai0109's avatar
      Khushidesai0109
      Skilled Sharer

      Hii huzzapac 

      YoY % Current Price = 
      VAR CurrentYearPrice = SUM('Property Table'[Current_Price])
      VAR PreviousYearPrice = 
          CALCULATE(
              SUM('Property Table'[Current_Price]),
              SAMEPERIODLASTYEAR('Transactional Table'[Transaction_Date])
          )
      RETURN
          IF(
              NOT ISBLANK(PreviousYearPrice),
              DIVIDE(CurrentYearPrice - PreviousYearPrice, PreviousYearPrice, 0),
              BLANK()
          )



      If this helps, I would appreciate your KUDOS!
      Did I answer your question? Mark my post as a solution!