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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
qkrekaamkese
New Member

"Translate" from MS Excel "IF" & "AND" & "OR" for a calculated column

 hope you can help me...

My data also consist of a column “Order No”, being defined as Text.

Normally such an order number starts with “010”, “020” etc., sometimes also with “SE*…” or “MI*…”

 

Now I do need a solution how to identify specific order numbers and return text “Sales Order Germany” as result.

 

In Excel I would have written as follows, but I do not get it translated into PBI language…

 

IF

'Table'[Order No] begins with “010”   OR

'Table'[Order No] begins with “SE*01”   OR
'Table'[Order No] begins with “MI*” AND ends with “*101”

 

THEN

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @qkrekaamkese ,

You can create a calculated column as below, please find the details in the attachment.

Column = 
IF (
    LEFT ( 'Table'[Order No], 3 ) = "010"
        || LEFT ( 'Table'[Order No], 5 ) = "SE*01"
        || (
            LEFT ( 'Table'[Order No], 3 ) = "MI*"
                && RIGHT ( 'Table'[Order No], 4 ) = "*101"
        ),
    "Sales Order Germany"
)

vyiruanmsft_0-1709691444511.png

Best Regards

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @qkrekaamkese ,

You can create a calculated column as below, please find the details in the attachment.

Column = 
IF (
    LEFT ( 'Table'[Order No], 3 ) = "010"
        || LEFT ( 'Table'[Order No], 5 ) = "SE*01"
        || (
            LEFT ( 'Table'[Order No], 3 ) = "MI*"
                && RIGHT ( 'Table'[Order No], 4 ) = "*101"
        ),
    "Sales Order Germany"
)

vyiruanmsft_0-1709691444511.png

Best Regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.