cancel
Showing results for 
Search instead for 
Did you mean: 
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' 🙂

 

View solution in original post

Vera_33
Solution Sage
Solution Sage

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
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Kudoed Authors