Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Aamir_khan
Advocate V
Advocate V

Need Help in Custom Column query

Hi All,

 

I am stuck Custom Column query. Can you please provide extact query of the below issue

 

I want to create this logic:

=IF( [@[QTE_AJUSTE]]=0, [@[EVP.PRXVDU*EVP.QTECDE]]/[@QTECDE], [@[EVP.PRXVDU*EVP.QTECDE]]/[@[QTE_AJUSTE]] )

 

And I wrote the query but I face issue:

if(([TYPEVE]="AVC"),0,if(([FAMPRO]="11") +
([FAMPRO]="14")),[(PRO.POIDS*DECODE(EVE.TYPEVE,''AVC'',0,EVP.QTECDE)/1000)],[QTECDE])

 

If you help me to resolved the issueIf you help me to resolved the issue

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Aamir_khan , What is this formula trying to do is not very clear

 

Syntax would be like

if[TYPEVE]="AVC" then 0 else if FAMPRO]="11" or [FAMPRO]="14" then <formala> else <>

View solution in original post

2 REPLIES 2
v-zhenbw-msft
Community Support
Community Support

Hi @Aamir_khan ,

 

The M query conditionals logic is like this,

if-expression:

       if if-condition then true-expression else false-expression

Please refer this document,

https://docs.microsoft.com/en-us/powerquery-m/m-spec-conditionals

 

Or you can choose the conditional column to add a new column, please refer this blog.

https://radacad.com/conditional-column-in-power-bi-using-power-query-you-can-do-anything

 

If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data?

It will be helpful if you can show us the exact expected result based on the tables.

Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Aamir_khan , What is this formula trying to do is not very clear

 

Syntax would be like

if[TYPEVE]="AVC" then 0 else if FAMPRO]="11" or [FAMPRO]="14" then <formala> else <>

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.