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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
DrHematite
Frequent Visitor

Graphing data over disparate dates

Hi everyone,

 

I have a dataset with a table structured as follows:

 

DatePart NumberAccumulated QtyChange
1/03/2020A150
4/03/2020B220
5/03/2020A16+1
6/03/2020B21-1

As you can see, it tracks the changes in inventory of a particular time on each date a transaction occurs.

What I want to be able to do is chart this data, but over all dates. So in the above, we start with part number A1 with 5 pieces on 1/03, and gain another on 5/03. That means our available quantity was 5 on 1/03, 2/03, 3/03 and 4/03 changing to 6 on 5/03. That's what I want to be able to show, but I don't have the dates in between.

Appreciate any help to do this across all the part numbers and for contiguous dates.

1 ACCEPTED SOLUTION

@DrHematite I think you want this output 

 

blank dates.gif

and here is the measure to achieve this, make sure you have a calendar table in your model. There are many blog posts on how to add calendar table, once this table is added, create relationship between the calendar table with your data table and calendar table will be on the one side of the relationship.  Would appreciate Kudos 🙂 if my solution helped.

 

Value = 
VAR __startDate = CALCULATE ( MIN ( Running[Date] ), ALLSELECTED( 'Calendar'[Date] ) )
VAR __endDate = CALCULATE ( MAX ( Running[Date] ), ALLSELECTED( 'Calendar'[Date] )  )
VAR __whentoStop = IF (  MAX ( 'Calendar'[Date] ) <= __endDate, 1 )
VAR __lastDate = CALCULATE ( LASTDATE ( Running[Date] ), DATESBETWEEN( 'Calendar'[Date], __startDate, MAX ( 'Calendar'[Date] ) ) )
VAR __value = CALCULATE( MAX ( Running[Accumulated Qty] ), 'Calendar'[Date] = __lastDate ) * DIVIDE( __whentoStop, __whentoStop )
RETURN __value

 



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.

View solution in original post

3 REPLIES 3
v-easonf-msft
Community Support
Community Support

Hi , @DrHematite 

According to my  test , @parry2k   solution is  effective.

If it is ,please mark the his reply as Answered to close this thread.

So that ,other community members will easily find the solution when they get the same issue.

 

test pbix file

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@DrHematite 

both as new columns


max date = maxx(filter(table, table[Part Number] = earlier(table[Part Number]) && table[Date] < earlier(table[date])),table[date])

diff = maxx(filter(table, table[Part Number] = earlier(table[Part Number]) && table[Date] = earlier(table[max date ])),table[Accumulated Qty])-table[Accumulated Qty]

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@DrHematite I think you want this output 

 

blank dates.gif

and here is the measure to achieve this, make sure you have a calendar table in your model. There are many blog posts on how to add calendar table, once this table is added, create relationship between the calendar table with your data table and calendar table will be on the one side of the relationship.  Would appreciate Kudos 🙂 if my solution helped.

 

Value = 
VAR __startDate = CALCULATE ( MIN ( Running[Date] ), ALLSELECTED( 'Calendar'[Date] ) )
VAR __endDate = CALCULATE ( MAX ( Running[Date] ), ALLSELECTED( 'Calendar'[Date] )  )
VAR __whentoStop = IF (  MAX ( 'Calendar'[Date] ) <= __endDate, 1 )
VAR __lastDate = CALCULATE ( LASTDATE ( Running[Date] ), DATESBETWEEN( 'Calendar'[Date], __startDate, MAX ( 'Calendar'[Date] ) ) )
VAR __value = CALCULATE( MAX ( Running[Accumulated Qty] ), 'Calendar'[Date] = __lastDate ) * DIVIDE( __whentoStop, __whentoStop )
RETURN __value

 



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.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors