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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Ildar7070
Regular Visitor

Count items where date is max

Hello everybody, 

I have an interesting problem and need your help.

Use Case:

Imagin, you get a list of ticket changes. A Ticket can be in the status "to do", "doing" and "done". You receive an export, that tracks the changes. For example, the statsu of ticket number one, changed from "to do" to "doing". You get a list in the structure as following:

 

Datumkeyold_statusnew_status
01.01.2022key1 1_to do
01.01.2022key2 1_to do
01.01.2022key3 1_to do
03.01.2022key11_to do2_doing
03.01.2022key21_to do2_doing
04.01.2022key12_doing3_done
05.01.2022key31_to do2_doing
06.01.2022key22_doing3_done

 

Goal:

The goal is to create a chart, that shows the number of tickets in a particular status at any given time. Basically a ramp up Curve. 

 

Approach:

To show the ramp up curve, I should count the number of last changes per ticket untill a specific date.

The query was linked with a date table. 

With the Measure below, I was able to count the number of tickets until a specific date. 

 

 

 

Measure =
CALCULATE(COUNT('Änderungen'[key]),
    'Date'[Date]<=MAX('Date'[Date]),HERE SHOULD BE THE SECOND FILTER EXPRESSION)

 

 

 

Resulting in something like this:

Ildar7070_0-1668799009222.png

But in here, the Measure is counting all the changes. I only need the last change of every ticket until a specific date. 

 

Hopefully you can help me out with this. You can find the file via my Onedrive Link here 

 

 

 

Many thanks in advance and I hope you can help me. I really need your help

@amitchandak @Greg_Deckler @Ashish_Mathur @parry2k 

 

4 REPLIES 4
parry2k
Super User
Super User

@Ildar7070 it should be easy. I would recommend creating a sample pbix file and share using one drive/google drive. It will help to provide the solution. If I understood correctly, a ticket can have multiple updates during a day and if you are looking at it by date, you want to put that ticket in the respective bucket for that day, correct?

 

Again, I would recommend sharing sample pbix. Cheers!!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Ashish_Mathur
Super User
Super User

Hi,

In a simple table, show the exact result that you are expecting.


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

@Ildar7070 check this video on my YT channel which addresses something similar. How to get value of each product based on the most recent transaction - Power BI - YouTube

 

And don't forget to subscribe to the channel 

😌 

Cheers,

P



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k Unfortunately, this is not as easy as I thought. Calculating the last item only is not helping because this only iterates once over the whole table. But I need to get the latest value for each iteration. 

In other words, for each day, give me a table with all the changes that happened until this current day and count only the latest changes per key. Then go into the next iteration and do the same thing for next day

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors