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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
msantillan
Helper II
Helper II

"Like" Translate to M query

Can anyone help me translate this into M query? I have this DAX query where I need to see this in power query because of columns I need to aggregate. Thanks.

 

Check Type =
if('AUM Config'[MOD_REPORTING]=BLANK()&&'AUM Config'[AFFILIATION]="AMG Managed"&&'AUM Config'[Capital commitment/Notes etc for exclusion]="Include",
if(SEARCH("Life Insurance", 'AUM Config'[CLIENT_NAME],,0)<>0||'AUM Config'[CLIENT_NAME]="AGL SA IV Intermediate Government MBS Subaccount",
"L&R",
if(SEARCH("AMERICAN HOME ASSURANCE COMPANY", 'AUM Config'[CLIENT_NAME],,0)=0,"Reconciling item","General insurance")
),BLANK())

 

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @msantillan 

 

Try this.

if [MOD_REPORTING] = "" and [AFFILIATION] = "AMG Managed" and [#"Capital commitment/Notes etc for exclusion"] = "Include" then if Text.Contains( [CLIENT_NAME], "Life Insurance" ) or [CLIENT_NAME] ="AGL SA IV Intermediate Government MBS Subaccount" then "L&R" else if not Text.Contains( [CLIENT_NAME], "AMERICAN HOME ASSURANCE COMPANY" ) then "Reconciling item" else "General insurance" else ""

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

 

View solution in original post

4 REPLIES 4
Mariusz
Community Champion
Community Champion

Hi @msantillan 

 

Can you create a data sample for testing?

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

 

Mariusz
Community Champion
Community Champion

Hi @msantillan 

 

Try this.

if [MOD_REPORTING] = "" and [AFFILIATION] = "AMG Managed" and [#"Capital commitment/Notes etc for exclusion"] = "Include" then if Text.Contains( [CLIENT_NAME], "Life Insurance" ) or [CLIENT_NAME] ="AGL SA IV Intermediate Government MBS Subaccount" then "L&R" else if not Text.Contains( [CLIENT_NAME], "AMERICAN HOME ASSURANCE COMPANY" ) then "Reconciling item" else "General insurance" else ""

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 

 

@Mariusz Your solution had an error, however I just replaced the blank ("") values into null and it worked perfectly. Many thanks!!

 


@Mariusz wrote:

Hi @msantillan 

 

Try this.

 

if [MOD_REPORTING] = "" and [AFFILIATION] = "AMG Managed" and [#"Capital commitment/Notes etc for exclusion"] = "Include" then if Text.Contains( [CLIENT_NAME], "Life Insurance" ) or [CLIENT_NAME] ="AGL SA IV Intermediate Government MBS Subaccount" then "L&R" else if not Text.Contains( [CLIENT_NAME], "AMERICAN HOME ASSURANCE COMPANY" ) then "Reconciling item" else "General insurance" else ""

 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn


 


 

 

@Mariusz  Hi Mariusz, I created a sample PBIx file . I'll also try the solution you suggested. 

Here is the sample

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.