Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Convert SQL to Dax

I have an sql query need to convert in dax with 3 statments.

query

  • Anonymous  It seems you have single quotes as part of your data itself in the SQL query but where as in DAX you are not considering that. 

     

    For Example - In SQL you are looking for 'Flat Fee Per Group' but in DAX you are looking for Flat Fee Per Group. Give a try including single quotes in your DAX search as well.

  • Hi Anonymous ,

     

    Have you solved your problem?

     

    If you have solved, please accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

     

    In addition, it seems that you're trying to achive if function in Power BI.

     

    You could have a reference of the IF fomula below. 

     

    = IF('Table_Name'[Column_Name]= " " ,'Table_Name1'[Amount],0)

    If you still need help, please share your dummy pbix which can reproduce your scenario so that we can help further on it.

     

    Best  Regards,

    Cherry

2 Replies

  • PattemManohar's avatar
    PattemManohar
    Community Champion

    Anonymous  It seems you have single quotes as part of your data itself in the SQL query but where as in DAX you are not considering that. 

     

    For Example - In SQL you are looking for 'Flat Fee Per Group' but in DAX you are looking for Flat Fee Per Group. Give a try including single quotes in your DAX search as well.

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi Anonymous ,

     

    Have you solved your problem?

     

    If you have solved, please accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

     

    In addition, it seems that you're trying to achive if function in Power BI.

     

    You could have a reference of the IF fomula below. 

     

    = IF('Table_Name'[Column_Name]= " " ,'Table_Name1'[Amount],0)

    If you still need help, please share your dummy pbix which can reproduce your scenario so that we can help further on it.

     

    Best  Regards,

    Cherry