Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
emmetk
Frequent Visitor

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!

1 ACCEPTED SOLUTION

Hi,

You may refer to my solution here.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

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

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.

Hi,

I think i have finally solved the problem.  Are you still interested in getting this solution?

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @Ashish_Mathur,

 

Yes, I am still looking for a solution to this! Thank you for continuing to work on this - anything you are able to share would be appreciated.

Hi,

You may refer to my solution here.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you @Ashish_Mathur.

 

This does solve the problem. However, is it possible to do this without duplicating the input data table for every relevant date? The mock data was only 5 or so records, but your method increased that record count to over 300. Considering my real data consists of thousands of records over many years, this method would not be sustainable in the long run. What do you think?

Hi,

It could be unsustainable.  Only you can try and offer feedback.  This is the only method i know.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

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


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.