none
Help me with the wrong RRS feed

  • Question

  • Hi everybody!

    I need help us with the IF Function in the Power BI. Please, show me the error in the formula bellow. I can tryed everything...rs

    = IF([Unidade de Custo]="Mês";[Valor Item Planejado_Onc]*[Quantidade do Item]*[Meses de Servico];[Valor Item Planejado_Onc]*[Quantidade do Item])

    Any help greatly appreciated



    • Edited by Furiati Tuesday, October 10, 2017 3:05 PM
    Tuesday, October 10, 2017 3:02 PM

Answers

  • if should be lowercase, and I haven't seen a ; before in an if statement.

    Here's an example:

    if Text.Contains([ProjectCategory],"DSC")=true then "DSC" else if Text.Contains([ProjectCategory], "Maint")=true then "Maintenance" else " "


    Ian

    Tuesday, October 10, 2017 6:00 PM

All replies

  • if should be lowercase, and I haven't seen a ; before in an if statement.

    Here's an example:

    if Text.Contains([ProjectCategory],"DSC")=true then "DSC" else if Text.Contains([ProjectCategory], "Maint")=true then "Maintenance" else " "


    Ian

    Tuesday, October 10, 2017 6:00 PM
  • If this is a DAX function (from the data model), you would have to replace the ";" by ",".

    Imke Feldmann - MVP Data Platform (PowerBI) - http://www.TheBIccountant.com 

    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful - Thanks!

    Tuesday, October 10, 2017 8:36 PM
    Moderator
  • If this is a DAX function (from the data model), you would have to replace the ";" by ",".

    Imke Feldmann - MVP Data Platform (PowerBI) - http://www.TheBIccountant.com 

    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful - Thanks!

    In some locales ';' is a valid function argument delimiter instead of ',' for DAX formulas. It's quite possible that if this is meant to be a DAX formula then it could be that this expression is being defined in a filter context but referring to columns without an aggregation function being applied.

    @Furiati: Please can you confirm whether this was meant to be a DAX or Power Query formula, and where in Power BI you are trying to create it?


    Regards,

    Michael Amadi

    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)

    Website: http://www.nimblelearn.com, Twitter: @nimblelearn

    Monday, February 5, 2018 7:12 PM
    Moderator