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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors