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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
GunnerJ
Post Patron
Post Patron

What function to use to leave out service orders that contain a specific task?

I need to disregard any Service Order number that contains the task "WAITFORINS". All of my data is currently within one table and I have custom columns calculating the time the tasks took. Any service order that contains the specific task though is errant and needs to be ignored. 

 

Each Service Order has multiple tasks so what function(s) can I use to ignore those service orders? It can't just be as simple as "TASK <> "WAITFORINS" as that just gets rid of those specific rows when I need to get rid of all rows of the same Service Order number. 

 

Thanks

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@GunnerJ there are many ways to do this, one way is to add a new column using following DAX to see if there is Task with WAITFORINS, and after that filter that service whereever that WAITFORINS = 1

 

to add new column

 

Is Wait Service = 
VAR __isWait = 
CALCULATE(
    COUNTROWS( Table ),
    ALLEXCEPT( Table , Table [Service] ),
    Table [Task] = "WAITFORINS"
)
RETURN
IF( __isWait > 0, 1, 0 )

Now for any calculation, let's assume you have qty to sum up where service doesn't have task with WAITFORINS

 

Total Qty = 
CALCULATE(
SUM( Table[Qty] ),
Table[Is Wait Service] = 0 
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

2 REPLIES 2
parry2k
Super User
Super User

@GunnerJ there are many ways to do this, one way is to add a new column using following DAX to see if there is Task with WAITFORINS, and after that filter that service whereever that WAITFORINS = 1

 

to add new column

 

Is Wait Service = 
VAR __isWait = 
CALCULATE(
    COUNTROWS( Table ),
    ALLEXCEPT( Table , Table [Service] ),
    Table [Task] = "WAITFORINS"
)
RETURN
IF( __isWait > 0, 1, 0 )

Now for any calculation, let's assume you have qty to sum up where service doesn't have task with WAITFORINS

 

Total Qty = 
CALCULATE(
SUM( Table[Qty] ),
Table[Is Wait Service] = 0 
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Iamnvt
Continued Contributor
Continued Contributor

you can try this measure:

 

Time Measure = 
  VAR
__temptable = FILTER(
            ADDCOLUMNS (
                VALUES ( 'Table'[Service Order number] ),
                "CombinedTask", SEARCH("WAITFORINS", CONCATENATEX (
                    CALCULATETABLE (
                        VALUES ( 'Table'[TASK] ),
                        'Table'[Service Order number] = EARLIER ( 'Table'[Service Order number] )
                    ),
                    'Table'[TASK],
                    ","
                ),,0)
            ), [CombinedTask] = 0)
RETURN
CALCULATE(SUM('Table'[Time]), __temptable)

here is PBI file:

https://1drv.ms/u/s!Aps8poidQa5zk6shmJTnqUOhqnMT2Q

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors