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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Jackie003
Frequent Visitor

Recreate command from Access to PowerQuery

Hello, 

I would like to recreate query from Access to PowerQuery M language, but I have a problem to do it. Could you help me with that?

 

IIf (Pivot1.[Sales Country Code]=Pivot1.[Sales Orig Country Code],
IIf((Pivot1.Supplier="LH" And Pivot1.[Sales Dest Country]="DE" ) OR (Pivot1.Supplier="LX" And Pivot1.[Sales Dest Country]="CH" )
OR (Pivot1.Supplier="OS" And Pivot1.[Sales Dest Country]="AT" ) OR (Pivot1.Supplier="SN" And Pivot1.[Sales Dest Country]="BE" ),"P2P",
IIF(Pivot1.[Sales Dest Area]="EU","EU<>P2P",Pivot1.[Sales Dest Area])) ,
IIF(Pivot1.[Sales Dest Country]= Pivot1.[Sales Country Code], "XBorder","Transversal" )) AS [O&D Traffic],

1 ACCEPTED SOLUTION
Jackie003
Frequent Visitor

Forget about it! I did it by myself. The solusion is:

if [Sales Country Code]=[Sales Orig Country Code] then
(if ([Supplier] = "LH" and [Sales Dest Country]="DE") or ([Supplier] = "LX" and [Sales Dest Country] = "CH")

or ([Supplier]="OS" and [Sales Dest Country]="AT") or ([Supplier]="SN" and [Sales Dest Country]="BE")

then "P2P"

else (if [Sales Dest Area]="EU" then "EU<>P2P" else [Sales Dest Area]))

else (if [Sales Dest Country]=[Sales Country Code] then "XBorder" else "Transversal")

View solution in original post

1 REPLY 1
Jackie003
Frequent Visitor

Forget about it! I did it by myself. The solusion is:

if [Sales Country Code]=[Sales Orig Country Code] then
(if ([Supplier] = "LH" and [Sales Dest Country]="DE") or ([Supplier] = "LX" and [Sales Dest Country] = "CH")

or ([Supplier]="OS" and [Sales Dest Country]="AT") or ([Supplier]="SN" and [Sales Dest Country]="BE")

then "P2P"

else (if [Sales Dest Area]="EU" then "EU<>P2P" else [Sales Dest Area]))

else (if [Sales Dest Country]=[Sales Country Code] then "XBorder" else "Transversal")

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.