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
Anonymous
Not applicable

Issue with <= and > in Formula

Hi Everyone,

 

As you can see below, I have this Power Bi formula. It looks the symbol <= (Less than or Equal) and > (Greater than) are not working in the formula below. As you can see from the results section below shows the formula is still pulling created dates over Nov 30, 2021, and resolved date less then Nov,11 2021. How can I solve this issue? or are the symbols not the issue?

 

What I am trying to do:

I want to get is the date difference between two dates if they are within a certain date range. But if there is no resolved date then it should calculate created date to Nov 11,2021.  

 

Formula:

Nov 21 Open Age = IF('FreshService RAW DATA'[Created Date] <=Date(2021,11,30) && (ISBLANK('FreshService RAW DATA'[Resolved Date] || 'FreshService RAW DATA'[Resolved Date] > Date(2021,11,30))), DATEDIFF('FreshService RAW DATA'[Created Date], Date(2021,11,30), DAY), DATEDIFF('FreshService RAW DATA'[Created Date],DATE(2021,11,30), DAY))

 

Results:

          11/30/2021 
Ticket IDTicket TypePriorityImpactUrgencySourceStatusCreated DateResolved DateClosed DateNov 21 Open Age 
147917Service RequestMediumLowLowPortalClosed1/8/20201/8/20201/10/2020692 
146318Service RequestLowLowLowPhoneClosed1/2/20201/2/20201/4/2020698 
163838IncidentLowLowLowEmailClosed3/5/20203/5/20203/5/2020635 
160330Service RequestLowLowLowEmailClosed2/24/20202/25/20202/27/2020645 
146691IncidentLowLowLowPortalIn Progress1/3/2020  697Good Data 
150448Service RequestMediumLowLowPortalEscalated1/17/2020  683Good Data 
402069IncidentMediumMediumMediumPhonePending4/14/2021  230Good Data 
495521IncidentLowLowLowPortalEscalated9/1/2021  90Good Data 
474556Service RequestMediumLowLowPortalClosed8/2/20211/24/20221/24/2022120Good Data 
562728IncidentLowLowLowEmailClosed12/10/202112/14/202112/16/2021-10 
556303Service RequestLowLowLowEmailClosed12/2/202112/2/202112/4/2021-2 
568661IncidentLowLowLowPhoneResolved12/20/202112/20/2021 -20 
557772IncidentLowLowLowEmailResolved12/3/202112/6/2021 -3 

 

 

SamuelTesf_0-1650576144567.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

 

it seems possible to get the result you are looking for with this simple instruction, but maybe I didn't quite understand the logic you want to apply.

 Table.AddColumn(#"FreshService RAW DATA", "open age", each Duration.Days(#date(2021,11,30)-[Created Date]) )

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

 

it seems possible to get the result you are looking for with this simple instruction, but maybe I didn't quite understand the logic you want to apply.

 Table.AddColumn(#"FreshService RAW DATA", "open age", each Duration.Days(#date(2021,11,30)-[Created Date]) )

 

BA_Pete
Super User
Super User

Hi @Anonymous ,

 

A couple of things:

 

- Can you describe specifically what you want this calculation to do please? You say you want to get "the date difference between two dates if they are within a certain date range", but you don't actually specify which dates/ranges. As your calculation isn't currently working as expected, I obviously can't use your current calculation as an indicator of what it *should* do.

 

- Your last two arguments in the IF statement resolve to the same outcome (they're both  DATEDIFF('FreshService RAW DATA'[Created Date], DATE(2021, 11, 30), DAY) ). Hopefully this will be explained via my first point.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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