Forum Discussion

lawadaa's avatar
lawadaa
Icon for Helper I rankHelper I
3 years ago
Solved

create a custom column that returns a value if number is below specific cap value

i'm trying to create a column that checks if the achievement is less than 0.5 , it should round the number to 0.5 otherwise, it should return the number as is. for example , if achievement is 0.2 or 0.3 , the column should return 0.5 and if achievment is 1.2 it will return 1.2.  i tried to create the custom column with below code but it didn't work.

if ([achievement])<0.5 then 0.5 else ([achievement])

 

  • Looks like your numbers are in text format. You can do this

    if Number.From([achievement])<0.5 then 0.5 else Number.From([achievement])

    A shorter construction would be following

    List.Max({Number.From([achievement]), 0.5})

1 Reply

  • Vijay_A_Verma's avatar
    Vijay_A_Verma
    Icon for Most Valuable Professional rankMost Valuable Professional

    Looks like your numbers are in text format. You can do this

    if Number.From([achievement])<0.5 then 0.5 else Number.From([achievement])

    A shorter construction would be following

    List.Max({Number.From([achievement]), 0.5})