Forum Discussion

Fusilier2's avatar
Fusilier2
Helper V
1 year ago
Solved

Measure returning zero

Can anybody see where I gone wrong with this measure:

KPI Incr good % Total =
VAR Excl_Casuals_MOM =
IF(HR_data[Headcount Excl Casuals month on month]>0,1,0)
VAR Apprentices_MOM=
IF(HR_data[Apprentices month on month]>0,1,0)
VAR mytest =12
RETURN
DIVIDE(
    (Excl_Casuals_MOM+Apprentices_MOM),
    mytest)
 
As the first two variables both return 1 I'm expecting to see 0.166 (16.6%) calculated from  2/12. Instead its returning zero.

 

  • Fusilier2 , Try using

    DAX
    KPI Incr good % Total =
    VAR Excl_Casuals_MOM =
    IF(HR_data[Headcount Excl Casuals month on month] > 0, 1, 0)
    VAR Apprentices_MOM =
    IF(HR_data[Apprentices month on month] > 0, 1, 0)
    VAR mytest = 12
    VAR Total_MOM = Excl_Casuals_MOM + Apprentices_MOM
    RETURN
    DIVIDE(Total_MOM, mytest)

2 Replies

  • Fusilier2 , Try using

    DAX
    KPI Incr good % Total =
    VAR Excl_Casuals_MOM =
    IF(HR_data[Headcount Excl Casuals month on month] > 0, 1, 0)
    VAR Apprentices_MOM =
    IF(HR_data[Apprentices month on month] > 0, 1, 0)
    VAR mytest = 12
    VAR Total_MOM = Excl_Casuals_MOM + Apprentices_MOM
    RETURN
    DIVIDE(Total_MOM, mytest)