Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Cost performance Index calculation

Hello,   I am new to power BI pls bear with me. I am trying to calculate Cost performance Index of a project within a fiscal year. Some of the project have a value of "0" for a specific month and s...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous 
    Please try this following measure and let me know if you're able to achieve the required scenario.

    Test Measure =
    VAR BlankValue = CALCULATE(COUNT(AnyColumn), Value = BLANK())
    VAR Zeromonth = CALCULATE(COUNT(AnyColumn), Value = 0)
    VAR CPI =
    DIVIDE(BlankValue, ZeroMonth, 0) * DIVIDE(Monthly Savings, YTD Savings, 0)
    RETURN
    SWITCH(TRUE(),
    CPI<1, "Over Budget",
    CPI>1, "Under Budget",
    CPI=1, "On Budget"
    )

    I hope it works.
    Thank you.