Forum Discussion

WhaleWatcher222's avatar
1 year ago
Solved

Show score to one dp in M Script

Hi Experts

 

See if formula as a custome column in Power Query -Where the Helper column is Apples i want the end result to be displayed in the new column to 1dp esle just score to 0 dp. How can i amend the following to accommendate

 

= if[Helper] = "Apples" then [Score] * 100 else [Score]

  • Hi WhaleWatcher222 ,

    If I understood you only want to see 1 decimal points if apples else all rest is 0 decimals as the output? If that's the case the following should work:

     

    = if [Helper] = "Apples" then Number.Round([Score] * 100, 1) else Number.Round([Score], 0)

     

     

1 Reply

  • Hi WhaleWatcher222 ,

    If I understood you only want to see 1 decimal points if apples else all rest is 0 decimals as the output? If that's the case the following should work:

     

    = if [Helper] = "Apples" then Number.Round([Score] * 100, 1) else Number.Round([Score], 0)