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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
ratercero
Helper III
Helper III

Column not performing Calculation

Hello, I have  a column not performing the calculation for certain rows.

 

The formula is:

 

PROCESS_CATEGORY = IF(
    (t_Batch[DESCRIPTION]="AB"
     ||t_Batch[DESCRIPTION]="LT"
     ||t_Batch[DESCRIPTION]="DA"
     ||t_Batch[DESCRIPTION]="RE"),
     "WASHING",
     if(
         (t_Batch[DESCRIPTION]="DM"
     ||t_Batch[DESCRIPTION]="RP"),
     "REDYE",
     IF(
         (t_Batch[DESCRIPTION]="PM"
     ||t_Batch[DESCRIPTION]="PS"),
         "MAINT",
         if(
             (t_Batch[DESCRIPTION]="CC"
     ||t_Batch[DESCRIPTION]="LP"),
     "CE",
     if(
         t_Batch[DESCRIPTION]="SB",
         "REBLEACH",
         IF(
             t_Batch[DESCRIPTION]="MT",
             "READDS",
             IF(
                 t_Batch[DESCRIPTION]="CA",
                 "CA",
             iF(
                 t_Batch[DESCRIPTION]="OK",
				 IF( t_Batch[PNC]<>"OK",
                 t_Batch[PNC],
                 IF(
                     t_Batch[c_NumOfAdditions]>0,
                     "ADDITION",
					 IF(t_Batch[TIMES_PROCESSED]>2,
						 "MULTI-PROCESS",
                     "OK")))))))))))


It does not return "OK" for the last condition in all rows, here is a print screen:

 

Capture.JPG

 

 

 

Why is this happening?

 

Thanks in advance for the support.

 

RT

1 ACCEPTED SOLUTION
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @ratercero,

 

Is that the value of PROCESS_CATEGORY should be "OK" if t_Batch[DESCRIPTION] = "OK"?

 

If that is case, you may left a ResultTrue value for the condition if t_Batch[DESCRIPTION] = "OK".

IF ( t_Batch[DESCRIPTION] = "OK", ResultTrue, if(...))

 

Following is modified formula for your reference. Smiley Happy

PROCESS_CATEGORY =
IF (
    ( t_Batch[DESCRIPTION] = "AB"
        || t_Batch[DESCRIPTION] = "LT"
        || t_Batch[DESCRIPTION] = "DA"
        || t_Batch[DESCRIPTION] = "RE" ),
    "WASHING",
    IF (
        ( t_Batch[DESCRIPTION] = "DM"
            || t_Batch[DESCRIPTION] = "RP" ),
        "REDYE",
        IF (
            ( t_Batch[DESCRIPTION] = "PM"
                || t_Batch[DESCRIPTION] = "PS" ),
            "MAINT",
            IF (
                ( t_Batch[DESCRIPTION] = "CC"
                    || t_Batch[DESCRIPTION] = "LP" ),
                "CE",
                IF (
                    t_Batch[DESCRIPTION] = "SB",
                    "REBLEACH",
                    IF (
                        t_Batch[DESCRIPTION] = "MT",
                        "READDS",
                        IF (
                            t_Batch[DESCRIPTION] = "CA",
                            "CA",
                            IF (
                                t_Batch[DESCRIPTION] = "OK",
                                "OK",
                                IF (
                                    t_Batch[PNC] <> "OK",
                                    t_Batch[PNC],
                                    IF (
                                        t_Batch[c_NumOfAdditions] > 0,
                                        "ADDITION",
                                        IF ( t_Batch[TIMES_PROCESSED] > 2, "MULTI-PROCESS", "OK" )
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )
)

 

Regards

View solution in original post

2 REPLIES 2
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @ratercero,

 

Is that the value of PROCESS_CATEGORY should be "OK" if t_Batch[DESCRIPTION] = "OK"?

 

If that is case, you may left a ResultTrue value for the condition if t_Batch[DESCRIPTION] = "OK".

IF ( t_Batch[DESCRIPTION] = "OK", ResultTrue, if(...))

 

Following is modified formula for your reference. Smiley Happy

PROCESS_CATEGORY =
IF (
    ( t_Batch[DESCRIPTION] = "AB"
        || t_Batch[DESCRIPTION] = "LT"
        || t_Batch[DESCRIPTION] = "DA"
        || t_Batch[DESCRIPTION] = "RE" ),
    "WASHING",
    IF (
        ( t_Batch[DESCRIPTION] = "DM"
            || t_Batch[DESCRIPTION] = "RP" ),
        "REDYE",
        IF (
            ( t_Batch[DESCRIPTION] = "PM"
                || t_Batch[DESCRIPTION] = "PS" ),
            "MAINT",
            IF (
                ( t_Batch[DESCRIPTION] = "CC"
                    || t_Batch[DESCRIPTION] = "LP" ),
                "CE",
                IF (
                    t_Batch[DESCRIPTION] = "SB",
                    "REBLEACH",
                    IF (
                        t_Batch[DESCRIPTION] = "MT",
                        "READDS",
                        IF (
                            t_Batch[DESCRIPTION] = "CA",
                            "CA",
                            IF (
                                t_Batch[DESCRIPTION] = "OK",
                                "OK",
                                IF (
                                    t_Batch[PNC] <> "OK",
                                    t_Batch[PNC],
                                    IF (
                                        t_Batch[c_NumOfAdditions] > 0,
                                        "ADDITION",
                                        IF ( t_Batch[TIMES_PROCESSED] > 2, "MULTI-PROCESS", "OK" )
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
    )
)

 

Regards

@v-ljerr-msft

How could I missed this! thank you!

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.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.