Forum Discussion

zraopingm's avatar
zraopingm
Icon for Helper IV rankHelper IV
1 year ago
Solved

YOY CHANGE FOR FIRST YEAR

Hello,  image 1, is a matrix report with reporting year in column, with 2025 and 2026 year.. rather than using time intelligence, I attempted to use new visual cal. to get the change between years ...
  • v-dineshya's avatar
    1 year ago

    Hi zraopingm ,

    Thank you for reaching out to the Microsoft Fabric Community forum.

     

    Please follow below steps.

    1. Created sample table (Table) with sample data.

     

    2. Created Measure (Total Amount) with below DAX code.

    Total Amount = SUM('Table'[TOTAL AMOUNT1])

    3. Created visual calculation with below DAX code.

    YOY CHANGE =
    VAR PrevAmount =
    CALCULATE(
    [Total Amount],
    OFFSET(-1, ORDERBY([Reporting Year]))
    )
    RETURN
    IF(
    ISBLANK(PrevAmount),
    BLANK(),
    [Total Amount] - PrevAmount
    )

    4. Please refer output snap, sample data and attached PBIX file.

     

    If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
    Thank you.