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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
YcnanPowerBI
Helper II
Helper II

Problem with adding IF statement

Hello. I am pretty new here so please forgive me if I post in the wrong place, etc. But onto my issue. I have a calculated column that assigns a time interval to each row. I now need it to look at another column if the original column is blank....and I can't seem to get it working. This is edad I have in my original calculated column 

 

= Table.AddColumn(#"Changed Type", "Custom", each Time.From(Text.From(Time.Hour(Time.From([paidTime])))&":"&(if Time.Minute(Time.From([paidTime]))>= 30 then "30" else "0")&":00"))

 

any help would be greatly greatly appreciated. Thank you. 

1 ACCEPTED SOLUTION
rubayatyasmin
Community Champion
Community Champion

Hi, @YcnanPowerBI 

 

Try this updated code,

 

= Table.AddColumn(#"Changed Type", "Custom", each 
    let 
        actualTime = if [paidTime] = "" then [otherTime] else [paidTime]
    in 
        Time.From(Text.From(Time.Hour(Time.From(actualTime)))&":"&(if Time.Minute(Time.From(actualTime)) >= 30 then "30" else "0")&":00")
)

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


View solution in original post

2 REPLIES 2
rubayatyasmin
Community Champion
Community Champion

Hi, @YcnanPowerBI 

 

Try this updated code,

 

= Table.AddColumn(#"Changed Type", "Custom", each 
    let 
        actualTime = if [paidTime] = "" then [otherTime] else [paidTime]
    in 
        Time.From(Text.From(Time.Hour(Time.From(actualTime)))&":"&(if Time.Minute(Time.From(actualTime)) >= 30 then "30" else "0")&":00")
)

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


It worked, thank you so much!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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