Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Filtering for a unique value but specific date requirements

I have a table which is pulled from our ticketing system and my goal is to create a couple metrics for reporting. In order to create one of my metrics, I need to generate a measure that I will call Days to Resolve (i.e. Resolved date - Created Date, the number will be an integer that will calculate how many days it took to resolve a ticket. 

These four columns I am working with. 

RITM #Request #Created DateResolved Date
RITM0123456REQ0444442021-01-042021-01-04
RITM0123987REQ0444442021-01-042021-01-04
RITM0234567REQ0444442021-01-042021-01-07

 

 

I want to be able to remove duplicate Request # so this column has only unique values.  At the same time, the record should have the earliest Created Date and the Latest Resolved Date.  So my table would look like this:

REQ0444442021-01-04

2021-01-07

 

 

It's simple to do conceptually and just by looking but I'm not sure how to perform this in Power BI. 

I tried remove duplicates in the second column but Power Bi doesn't know I want 2021-01-07.  I looked all over power query but couldn't find anything that can help me.  I'm still a novice with DAX.  Is there a feature in power query that can help me or is DAX the only way?  Can someone please help me?

 

 



3 Replies

  • Anonymous following image gives what I mean, I'm using column name from my table, in your case, it will be different column based on your table:

     

     

    Follow us on LinkedIn

     

    Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Wow that was a lot simplier than I had expected.  I spent quite a bit of time searching online, so thank you!

  • Anonymous in PQ, use group by, get min of created date and max of resolved date and group it by request # and that will do it.

     

    Follow us on LinkedIn

     

    Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.