Forum Discussion

SACooper's avatar
SACooper
Icon for Helper II rankHelper II
4 years ago
Solved

Performance Against Target Measure giving weird results within Matrix

 

The measure is as follows:

 

VAR _daysInView = COUNTROWS(VALUES(CIVICA_CompletedItems[ProcessedDate]))
VAR _numberOfStaff = COUNTROWS(VALUES(CIVICA_CompletedItems[ProcessedBy]))
--
VAR _flexitime = SUM('flexi UD_FullReport'[Day_TotalTime])
VAR _decimalHours = _flexitime / 60
VAR _dayValue = TIME(7,15,0) * 24
VAR _targetPerHour = _dayValue / 43
VAR _Target = ROUNDDOWN(_decimalHours / _targetPerHour,0)

VAR _performanceAgainstTargetPercentage = COUNT(CIVICA_CompletedItems[WorkType]) / _Target
VAR _performance = _performanceAgainstTargetPercentage - 1
RETURN

_performance
 
If I return _performanceAgainstTargetPercentage I get the correct percentages, its just when I take them away from 1 I then get the results displayed in the image above.

 

  • Luuky's avatar
    Luuky
    4 years ago

    Hi SACooper

    What i mean is for example

    KP = (1908-1685)/1685

    LW = (494-820)/820

    MW = (1090-1572)/1572

    This should give the value I assume you are looking for.

    Greetings,

    Luuk

6 Replies

  • <insert favoured expletive here> thank you for pointing this out, basic math that I should have be well adept at, tunnel vision, is the only excuse I can come up with.

     

    This works perfectly ... still confused why my previous math didn't work out but this did the trick 

     

    Thank you!

  • Hi SACooper,

    Its indeed pretty wierd that is does this. So if I understand correctly the output is not 0 without the -1?

    If that is the case can you show the output % that is shown. 

    What you can also try is add a measure with value 1 and change the type to %, then make another measure that substracts the newly made measure from _performanceAgainstTargetPercentage and look at all the values in a table and check what it does. 

    This is what it does for me:

     

    Greetings, 

    Luuk

     

    • SACooper's avatar
      SACooper
      Icon for Helper II rankHelper II

       

       

      This is what is happens when I return _performanceAgainstTargetPercentage. So as you can see I was expecting figures such as  102.86% (1.02), -24.12% (-0.24) etc. after subtracting 1

       

      ** Please ignore the infinity references there are to be expected as the underlying data for that time period has yet to be captured..

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

        Hi SACooper,

        What you can do is instead of doing -1 you can do - _target. In this scenario 100% = the target. Also use Divide() to divide. Hope this helps!

        Greetings, 

        Luuk