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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Delzy
New Member

Excel Formula to Power Query Custom Column Help!

Hi all,

 

Im trying to load all my columns that have formulas in to power query but im struggling with translating the  excel formula for one column into a custom column Power query equivalent formula that gets the same result.

 

Hope that makes sense.

 

The excel formula is :

=IFERROR(IFS(OR([@[Race Code (2)]]="04",[@[Race Code (2)]]="DO",[@[Race Code (2)]]="IN",[@[Race Code (2)]]="LE",[@[Race Code (2)]]="RE"),"ADJU",[@[Race Code (2)]]="AF","AFAF",[@[Race Code (2)]]="AX","AXAX",OR([@[Race Code (2)]]="20",[@[Race Code (2)]]="HS",[@[Race Code (2)]]="NA"),"COMM",[@[Race Code (2)]]="EW","EWEW",[@[Race Code (2)]]="EX","EXEX",[@[Race Code (2)]]="FS","FSFS",[@[Race Code (2)]]="GS","GSGS",OR([@[Race Code (2)]]="GV",[@[Race Code (2)]]="UN"),"GVGV",OR(LEN([@[INV_REF]])=8,LEN([@[INV_REF]])=10,LEFT([@[INV_REF]],4),LEN([@[INV_REF]])=4),LEFT([@[INV_REF]],4),OR(LEN([@[INV_REF]])=9,LEN([@[INV_REF]])=6,LEN([@[INV_REF]])=14,LEN([@[INV_REF]])=15,LEN([@[INV_REF]])=24),"GVGV"),"ADJU")

 

Please note the below in the formula are column headers.

  • Race Code (2)
  • INV_REF

 

Can someone help me convert the excel formula into a Power Query Custom Column M Expression.

1 REPLY 1
v-yanjiang-msft
Community Support
Community Support

Hi @Delzy ,

Based on the code you provided, not very clear about the expected result. Could you please provide a sample like below and the corresponding result?

vkalyjmsft_0-1670565742020.png

Best Regards,
Community Support Team _ kalyj

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors