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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
anettpb
Helper I
Helper I

IF function with date range and one additional condition

Hi All,

 

I would like to create a column, where I want to write whether it is Pre-order or an ad-hoc.

Can anyone help me how can I do that?

= IF(( 'Full data'[Delivery block]="DA" AND 'Full data'[Document Date]=2023.02.13 OR 2023.02.14),"Pre-order","Ad-hoc")

 

Thanks a lot!

 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @anettpb ,

 

If you want to create a calculated column, you can try this code.

Column =
IF (
    AND (
        'Full data'[Delivery block] = "DA",
        OR (
            'Full data'[Document Date] = DATE ( 2023, 02, 13 ),
            'Full data'[Document Date] = DATE ( 2023, 02, 14 )
        )
    ),
    "Pre-order",
    "Ad-hoc"
)

 

Best Regards,
Rico Zhou

 

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

4 REPLIES 4

Hello @anettpb 

You can try this, Add new column.

Column Name = IF(AND(OR('Full data'[Document Date]=2023.02.13 OR 2023.02.14)),'Full data'[Delivery block]="DA")"Pre-order","Ad-hoc")

Hope this helps !

Hello @JadhavVarsha_13 

 

Thanks a lot, I tried it, but it dropped syntax error.

I forgot to mention that would needed at a matrix, I do not know that it is matter or not.

Anonymous
Not applicable

Hi @anettpb ,

 

If you want to create a calculated column, you can try this code.

Column =
IF (
    AND (
        'Full data'[Delivery block] = "DA",
        OR (
            'Full data'[Document Date] = DATE ( 2023, 02, 13 ),
            'Full data'[Document Date] = DATE ( 2023, 02, 14 )
        )
    ),
    "Pre-order",
    "Ad-hoc"
)

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @Anonymous 

 

Thanks a lot, it is worked well 🙂

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.