The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 ID | Ticket Type | Priority | Impact | Urgency | Source | Status | Created Date | Resolved Date | Closed Date | Nov 21 Open Age | |
147917 | Service Request | Medium | Low | Low | Portal | Closed | 1/8/2020 | 1/8/2020 | 1/10/2020 | 692 | |
146318 | Service Request | Low | Low | Low | Phone | Closed | 1/2/2020 | 1/2/2020 | 1/4/2020 | 698 | |
163838 | Incident | Low | Low | Low | Closed | 3/5/2020 | 3/5/2020 | 3/5/2020 | 635 | ||
160330 | Service Request | Low | Low | Low | Closed | 2/24/2020 | 2/25/2020 | 2/27/2020 | 645 | ||
146691 | Incident | Low | Low | Low | Portal | In Progress | 1/3/2020 | 697 | Good Data | ||
150448 | Service Request | Medium | Low | Low | Portal | Escalated | 1/17/2020 | 683 | Good Data | ||
402069 | Incident | Medium | Medium | Medium | Phone | Pending | 4/14/2021 | 230 | Good Data | ||
495521 | Incident | Low | Low | Low | Portal | Escalated | 9/1/2021 | 90 | Good Data | ||
474556 | Service Request | Medium | Low | Low | Portal | Closed | 8/2/2021 | 1/24/2022 | 1/24/2022 | 120 | Good Data |
562728 | Incident | Low | Low | Low | Closed | 12/10/2021 | 12/14/2021 | 12/16/2021 | -10 | ||
556303 | Service Request | Low | Low | Low | Closed | 12/2/2021 | 12/2/2021 | 12/4/2021 | -2 | ||
568661 | Incident | Low | Low | Low | Phone | Resolved | 12/20/2021 | 12/20/2021 | -20 | ||
557772 | Incident | Low | Low | Low | Resolved | 12/3/2021 | 12/6/2021 | -3 |
Solved! Go to Solution.
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]) )
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]) )
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
Proud to be a Datanaut!