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
Anonymous
Not applicable

Condition With hours

Hello Everyone!

 

I need your help in calculating a column which give me either a 1 o 0, a 1 when in the column "HORA_INGRESO" is after 10:30 and the column "CD" is 1011, other wise the result wuld be 0.

I am usig this calculated column, and didnt work

HOUR = IF(CABECERAPEDIDOSAP[HORA_INGRESO]>"10:30" && CABECERAPEDIDOSAP[CD]="1011" ;1;0)

ddddd.PNG

Any Ideas?

 

Thanks for your help

2 ACCEPTED SOLUTIONS
edhans
Community Champion
Community Champion

Use the following formula for your calculated column:

 

IF(Times[Time]>TIME(10, 30, 0) && Times[CD]="1011",1,0)

 

You'll need to translate that to your column names, but the key is you are comparing your time column to the TIME() function. The && allows you to add additional comparisons to the IF() statement. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

 

Try this calculated column formula

 

=IF(AND(CABECERAPEDIDOSAP[HORA_INGRESO]>TIME(10,30,0);CABECERAPEDIDOSAP[CD]="1011");1;0)

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

 

Try this calculated column formula

 

=IF(AND(CABECERAPEDIDOSAP[HORA_INGRESO]>TIME(10,30,0);CABECERAPEDIDOSAP[CD]="1011");1;0)

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
edhans
Community Champion
Community Champion

Use the following formula for your calculated column:

 

IF(Times[Time]>TIME(10, 30, 0) && Times[CD]="1011",1,0)

 

You'll need to translate that to your column names, but the key is you are comparing your time column to the TIME() function. The && allows you to add additional comparisons to the IF() statement. 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

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.