Forum Discussion

emmetk's avatar
emmetk
Frequent Visitor
7 years ago
Solved

Summarize Data by Max Date

Hello!

 

I have a status transactions table as follows:

 

dateidstatus
1/1/2019ANew
1/15/2019AOpen
2/1/2019AClosed
2/15/2019BNew
3/1/2019BOpen
3/15/2019BClosed
4/1/2019AStop
4/15/2019BStop

 

I need to summarize IDs by Status over time. For example:

 

statusJanuaryFebruaryMarchApril
New0100
Open1000
Closed0120
Stop0002

 

Conceptually, I need to count the current status for each ID that is associated with the maximum transaction date that is earlier than the end of each time period. I'm able to get the counts by status and filter by date, but selecting only the maximum date for each ID is proving difficult.

 

Any help on this would be appreciated!

8 Replies

  • Hi,

    For March closed, the answer should be 1.  You may download my PBI file from here.

    Hope this helps.

    • emmetk's avatar
      emmetk
      Frequent Visitor

      Hi Ashish_Mathur 

       

      Thank you for your response!

       

      To clarify, I'm not just trying to organize raw transactions by status and month. I'm trying to summarize the current status of each ID by month. Since ID A moved to status = Closed in February and status = Stop in April, it is still in status = Closed in March. As such, the count of status = Closed in March should be 2.

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

        I have tried hard enough but have not been successful in solving it.  If you find a solution, please share it here.