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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
AdamDevis
New Member

IF Function

Looking for help with this.  Here is the formual I wrote:

Priority Status = if(TransfersBI[BOL Status]="In Transit",IF([Days in Transit]>10,"Alert",""), if(TransfersBI[BOL Status]="In Transit",IF([Days in Transit]>15,"priority","")))

 

There is a column that contains either the status of In Transit or Received.  I am only interested in if the shipment is still In tranist.

There is another column that says how long it is in transit for.  If it is greater than 10 days, then I want the Status to be alert.  If its greater than 15 days, i want it to say priority.

 

For this formula, it will create the status of Alert for everything over 10 and it will not ever assign antything a priority status.

2 ACCEPTED SOLUTIONS

Had some time to write the code:

 

Priority Status = if(TransfersBI[BOL Status]="In Transit",IF([Days in Transit]>15,"Priority",if([Days in Transit]>10,"Alert","")),"")

View solution in original post

v-chuncz-msft
Community Support
Community Support

@AdamDevis,

 

You may add SWITCH Function as well.

Column =
IF (
    TransfersBI[BOL Status] = "In Transit",
    SWITCH (
        TRUE (),
        [Days in Transit] > 15, "priority",
        [Days in Transit] > 10, "Alert"
    )
)
Community Support Team _ Sam Zha
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

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@AdamDevis,

 

You may add SWITCH Function as well.

Column =
IF (
    TransfersBI[BOL Status] = "In Transit",
    SWITCH (
        TRUE (),
        [Days in Transit] > 15, "priority",
        [Days in Transit] > 10, "Alert"
    )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BKirsch12
Resolver II
Resolver II

You'll want to evaluate priority before alert. Anything over 10 fulfills your IF condition, so the code never goes to check the >15. Check for >15, then check for > 10.

 

Had some time to write the code:

 

Priority Status = if(TransfersBI[BOL Status]="In Transit",IF([Days in Transit]>15,"Priority",if([Days in Transit]>10,"Alert","")),"")

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.