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
Alirezam
Helper V
Helper V

IF function on date with multiple criteria

Hi friends,

It looks quite simple and it works when I apply the "IF" function on the "Date" column to perform an operand on column 'kWh' as shown below. However, I have no success when I add multiple criteria to 'Date' for example I want to do this multiplication only for 3 days and my code is as below but the 'New column' comes with "Error"

 

if [date]=#date(2021,05,02) or [date]=#date(2021,05,03) then [kWh]*1000 else [kWh]

 

any idea please!Capture.PNG

1 ACCEPTED SOLUTION
Alirezam
Helper V
Helper V

Thanks, Vera, I think I solved it with expanding it into multiple 'else' and 'if' 🙂

 

View solution in original post

2 REPLIES 2
Alirezam
Helper V
Helper V

Thanks, Vera, I think I solved it with expanding it into multiple 'else' and 'if' 🙂

 

Vera_33
Resident Rockstar
Resident Rockstar

Hi @Alirezam 

 

What is the error? I saw your Date column was typed [date] here, is it the reason? M is case sensitive

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.