Forum Discussion

griffinst's avatar
griffinst
Icon for Helper I rankHelper I
1 year ago
Solved

Trend calculation in matrix by year

 

Trend calculation in matrix by year
 
  • The visual calc measure would be

    Versus previous = format(divide(([OP Amt/Service] - PREVIOUS([OP Amt/Service])),PREVIOUS([OP Amt/Service])),"percent")
    Hope this helps.

     

8 Replies

  • If you've got a version of PowerBI that has visual calculations (the button next to "New Measure" in the Home toolbar), you can use the following formula:

    Versus previous = DIVIDE([OP Amt/Service], PREVIOUS([OP Amt/Service]), 1) -1

     

     

  • Ashish_Excel's avatar
    Ashish_Excel
    Icon for Solution Supplier rankSolution Supplier

    The visual calc measure would be

    Versus previous = format(divide(([OP Amt/Service] - PREVIOUS([OP Amt/Service])),PREVIOUS([OP Amt/Service])),"percent")
    Hope this helps.

     

    • griffinst's avatar
      griffinst
      Icon for Helper I rankHelper I

      I need a slight modification.  I tried wrapping it in a "IF" statement but it didn't work.  I need 2025 to be blank as the year is not done so the calculation is misleading to users.

      • Ashish_Excel's avatar
        Ashish_Excel
        Icon for Solution Supplier rankSolution Supplier

        Hi,

        Modify the measure to

        Measure = if(min('Calendar'[Year])=year(today()),BLANK(),DIVIDE(([OP Amt/Service]-[OP Amt/Service PY]),[OP Amt/Service PY]))

        Hope this helps.

         

  • v-csrikanth's avatar
    v-csrikanth
    Icon for Community Support rankCommunity Support

    Hi griffinst 

    Thank you for being part of the Microsoft Fabric Community.

    As highlighted by Ashish_Excel , the proposed approach appears to effectively address your requirements. Could you please confirm if your issue has been resolved?
    If you are still facing any challenges, kindly provide further details, and we will be happy to assist you.

    Best Regards,
    Cheri Srikanth.