Forum Discussion
Select only Distinct Rows but get the earliest date from them
Hi All,
I'm attempting something with Power BI not sure if it's easy enough to do - but I have a CSV with multiple rows of data that is generated each week from our Ticket system(s) - so I need to run reports on the data that's generated weekly and then be able to break it down by month - thats the easy part - I have the CSV's being combined but the fun part is the following:
I need to get the Oldest ticket from the database, it's setup as such:
| Number | Open_date | state | Contact | Title | client | additional_row | additional_row_1 | additional_row_2 | additional_row_3 |
| JB-1234 | 01/03/2023 | Open | Phone | Access to System | Bobs Burgers | x | x | x | x |
| JB-1234 | 04/03/2023 | Pending | Phone | Access to System | Bobs Burgers | x | x | x | x |
| JB-1234 | 09/03/2023 | Pending | Phone | Access to System | Bobs Burgers | x | x | x | x |
Etc. - I have it filtering the data out for anything that's not an Open Status with
MS OldestTicket = CALCULATE(min(Database[Open_Date]),FILTER(Database, NOT Database[state] IN {"Closed Complete", "Cancelled", "Closed", "Closed Cancelled", "Canceled", "Closed Incomplete", "Closed Skipped", "Resolved"}))
I tried:
MS OldestTicket = CALCULATE(min(Database[Open_Date]),FILTER(Database, NOT Database[state] IN {"Closed Complete", "Cancelled", "Closed", "Closed Cancelled", "Canceled", "Closed Incomplete", "Closed Skipped", "Resolved"}))
with other variations using DISTINCT( etc. but not sure how to do it, essentially I need to ignore it if it's been closed at a later date and just grab the earliest.
1 Reply
- AnonymousNot applicable
Hi Anonymous ,
//with other variations using DISTINCT
Could you please explain what your expected output is? The result now looks like this.
Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum