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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
v-yiruan-msft
Community Support
Community Support

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

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

View solution in original post

1 REPLY 1
v-yiruan-msft
Community Support
Community Support

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

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

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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