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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Stuznet
Helper V
Helper V

If Statement Then Output Custom Text

Hi guys,

 

I'm having little trouble writing an IF statement. 

 

Here is the logic DateReceived minus Inv Date being greater or less than 50. 

This is the the function I wrote but is invalid. 

 

Column = IF (AND(('Table1 '[DateReceived]) - [InvDate] < 51 ),  "<50 Days","50+ Days ")

 

Can someone please help?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Stuznet

 

Use this.

 

Column = IF ( Table1[DateReceived] - Table1[InvDate] < 51 , "<50 Days","50+ Days ")

 

Thanks

Raj

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@Stuznet

 

The formula you have is invalide because you are using AND condition and only condition1 is listed. Here is how I fix it:

 

Column = IF ( DATEDIFF(
                      [InvDate], [DateReceived], Day) <50
                      ,"<50 Days"
                      ,"50+ Days ")
Anonymous
Not applicable

Hi @Stuznet

 

Use this.

 

Column = IF ( Table1[DateReceived] - Table1[InvDate] < 51 , "<50 Days","50+ Days ")

 

Thanks

Raj

@Anonymousperfect as always. 🙂 

Anonymous
Not applicable

Thank you @Stuznet 🙂

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.