Forum Discussion

mmowrey's avatar
mmowrey
Helper I
4 years ago
Solved

If less than statement

when i create a less than statment, why does power BI add records to table but the greater than statment works fine?   Below Goal = IF([Projection Accuracy 2] > .85, 1,0)
  • jdbuchanan71's avatar
    4 years ago

    Because you have rows where the value of [Projection Accuracy 2] is blank and PowerBI sees blank as < .08 so it gives you a 0.  You can change it to only return if [Projection Accuracy 2] is not blank.

    Below Goal = 
    VAR _ProjAcc = [Projection Accuracy 2]
    RETURN
    IF ( NOT ISBLANK ( _ProjAcc ), IF( _ProjAcc > .85, 1,0 ) )
  • mmowrey's avatar
    mmowrey
    4 years ago

    thanks so much .. this all worked.. one last question :)..   when i take sum then divide by another number why would it come up as 0

     

     

    Below Goal divided by Count of DriveID =
    DIVIDE([Below Goal Sum],COUNT(BloodDrive[DriveID]))
  • Anonymous's avatar
    Anonymous
    4 years ago

    mmowrey , 7 / 18 = 0.3888. If your measure [Below Goal divided by Count of DriveID] is formatted as Whole Number or to 0 decimal places, then it will display as zero.