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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
ChrisRafer5
New Member

Some questions about how can i use the functions "if" & "and"

So i got this table, with time value in it, and i need to get the SUM and the AVG of them, nonetheless the problem start when its a service time, so some services got no time, because people call at indevide times and it gets the "null" mark. And because of this, the final logic gets broken. And of all it, the system counts some of this services as "closed" and others as "open", because the closed ones gets generated by the bot of people calling at non working times, and the opened because actual employees forget to close it.

So my question is:

How can i make a time reduction column based on 

if the column "time of service" has the value "null", and the column status has the string "Open", then return "time of creation (of the service (this is another column in question)) - today date(already generate a column that display todays date) else "time of service".

 

if any type is dosent make sense please tell me and i will try to explain further, english is not my first language.

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@ChrisRafer5 let's start with this, add a new column

 

--if actual typed value is null use this
New Col = if ( Table[TimeofService] = "null" && Table[Status] = "Open", [Time of Creation] - Today, [TimeOfService] )

--if value is blank use this
New Col = if ( ISBLANK ( Table[TimeofService] ) && Table[Status] = "Open", [Time of Creation] - Today, [TimeOfService] )


 


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

@ChrisRafer5 let's start with this, add a new column

 

--if actual typed value is null use this
New Col = if ( Table[TimeofService] = "null" && Table[Status] = "Open", [Time of Creation] - Today, [TimeOfService] )

--if value is blank use this
New Col = if ( ISBLANK ( Table[TimeofService] ) && Table[Status] = "Open", [Time of Creation] - Today, [TimeOfService] )


 


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.

Thanks! It worked Just as intended, a life sevior 🙏

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Solution Authors
Top Kudoed Authors