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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Glenda
Helper I
Helper I

Using Greater than in a IF foumla

I am trying to set up a new column where 2 things must be met. One is the state and the other is depending on date. The standard formula i use in excel is not working. 

 

Policy = IF (AND('XOX Report'[STATE]=2,'XOX Report'[Date Of Injury]< 1/1/2000) ,"POL 1" , "POL 2")

 

What am i doing wrong?

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Dear @Glenda

    Try this:

Policy = IF( and(  value( W_DAY_D[Year]) = 2017,  value(FORMAT( W_DAY_D[Date], "YYYYMMDD")) < 20170901 ) ,"my True", "my False")

 

My result

If_Date.png

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Dear @Glenda

    Try this:

Policy = IF( and(  value( W_DAY_D[Year]) = 2017,  value(FORMAT( W_DAY_D[Date], "YYYYMMDD")) < 20170901 ) ,"my True", "my False")

 

My result

If_Date.png

MarcelBeug
Community Champion
Community Champion

< is less than, use > instead

 

Otherwise your formula works fine with me.

 

By the way please don't use "is not working": either provide the error message, or explain the actual result and the expected result.

Specializing in Power Query Formula Language (M)

If I use less than I get the faluse result and if I use greater than I get the ture result againt all records.

 

Thanks for the tip (first time posting)

 

Anonymous
Not applicable

@GlendaYou are welcome.

 

Can you post your script here (your last comment).

Maybe I'll help your case and your expectation.

 

Regards.

Hello all,

 

I am having troubles implementing this formala in one of my BI:

 

Badge Completion Status = if('Badges table'[Badges]="Bronze",IF([Badge count]>=3,"Complete","Not Complete"),IF('Badges table'[Badges]="Silver",IF([Badge count]>=2,"Complete","Not Complete"),IF('Badges table'[Badges]="Gold",IF([Badge count]>=4,"Complete","Not Complete"))))

 

It seems to work perfectly in Excel, but not in BI.

Short explanation: i want to show completion status based on number of badges received. If greater or equal than x, then show completed. Can you please help me? See below screen shot which shows incorrect results...

thanks in advance

Kevin

 

screen shot.PNG

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors