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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
graemejohnson
Helper II
Helper II

Building a Daily Summary table

Please can anyone help! 

 

I am trying to build a PowerBI report to sit on top of a job estimation system.

 

I have this table which shows a history of the jobs (IssueID) that have been estimated and the dates on which the estimate was provided.

 

2020-03-31_17h11_48.png

What I am attempting to do is to build daily summary that shows on any given date, the sum of the most recent (on or before the date in question) OriginalEstimate across all IssueID values e.g.

 

2020-03-31_17h24_48.png

I've been looking at this for a day and just cannot figure out how to pick out the appropriate values to sum up.

1 ACCEPTED SOLUTION

@graemejohnson 

I added a measure into original table 'Original Estimate History'

Measure Sum Estimated = 
VAR _lastDateTable = 
                    ADDCOLUMNS(
                    SUMMARIZE(
                        FILTER(
                            ALL('Original Estimate History'), 
                            'Original Estimate History'[DateModified] <= SELECTEDVALUE('Original Estimate History'[DateModified]) ),
                            'Original Estimate History'[IssueID],
                        "LastDate",
                        MAX('Original Estimate History'[DateModified])
                    ),
                    "EstimatedToDate",
                    CALCULATE(MAX('Original Estimate History'[OriginalEstimate]),'Original Estimate History'[IssueID]=EARLIER([IssueID]), 'Original Estimate History'[DateModified]=EARLIER([LastDate])))
RETURN
CALCULATE(SUMX(_lastDateTable, [EstimatedToDate]))

 

then created a visual

Снимок.PNG

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

17 REPLIES 17
az38
Community Champion
Community Champion

@graemejohnson 

why do not you just add to table visual 2 fields:

Date

Original Estimate aggregated as SUM

?

Безымянный.png


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

I've possibly misunderstood, but I'm not sure that's what I need.....I was going down the route of creating a summary table with a row for each date, and then it's the calculation of the sum of 'the most recent' estimate per Issue up to that point of time that I just cannot get my head around....on 26th March I need it to pull in a record from 26th and also one from the 25th

 

2020-03-31_17h44_43.png

@graemejohnson 

what is the [Sum (Original Estimate)] column?

give a statement if it is a calculated column


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

It's a measure....

 

Sum (Original Estimate) = SUM('Original Estimate History'[OriginalEstimate])
 
So I can make that less obscure by re-writing as follows....but the end result is the same 2020-03-31_18h02_05.png

@graemejohnson 

try

aaa = 
SUMMARIZE(
	'Original Estimate History',
	'Original Estimate History'[DateModified],
	"SUM",
	CALCULATE(
		SUM('Original Estimate History'[OriginalEstimate]),
		FILTER(
			ALL('Original Estimate History'),
			'Original Estimate History'[DateModified]<=EARLIER('Original Estimate History'[DateModified])
		)
	)
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Thanks for this......different results but still not what I'm expecting

The values for 25th and 26th look good but the last 2 rows are not what I'd expect...

Really appreciate your (hopefully continued) help!

 

2020-03-31_18h07_39.png

@graemejohnson 

I added a measure into original table 'Original Estimate History'

Measure Sum Estimated = 
VAR _lastDateTable = 
                    ADDCOLUMNS(
                    SUMMARIZE(
                        FILTER(
                            ALL('Original Estimate History'), 
                            'Original Estimate History'[DateModified] <= SELECTEDVALUE('Original Estimate History'[DateModified]) ),
                            'Original Estimate History'[IssueID],
                        "LastDate",
                        MAX('Original Estimate History'[DateModified])
                    ),
                    "EstimatedToDate",
                    CALCULATE(MAX('Original Estimate History'[OriginalEstimate]),'Original Estimate History'[IssueID]=EARLIER([IssueID]), 'Original Estimate History'[DateModified]=EARLIER([LastDate])))
RETURN
CALCULATE(SUMX(_lastDateTable, [EstimatedToDate]))

 

then created a visual

Снимок.PNG

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

😀OMG!  You are a legend!


Thank you so, so much for taking time to help me!

Hoping you can help me take this further forward @az38 !

 

I now have these overall tables

1) Planning Details - for each item we plan to deliver we have a Planned Start date and Planned end date

2) Planning Calendar - for each row in Planning Details there are rows in this table for each date between Planned Start and Planned End

3) Remaining Estimate Changes - the original table for which the measure you gave me has been applied and which I'm happy is correct 🙂

2020-04-02_14h29_58.png

What I ultimately need to have the Planning Calendar showing the Remaining Estimated Hours per day  between Planned Start and Planned End e.g. for HIGHLANDER-3837 which runes from 02 March 2020 thru to 29 May 2020z...

 

DateRemaining Estimated Hours As At Date
02 March 20200
...all dates inbetween0
17 March 202015
...all dates inbetween15
26 March 2020195
...all dates inbetween195
01 April 2020225
...all dates inbetween225
29 May 2020225

 

 

 

@graemejohnson 

measure in your Calendar table could look smth like

Remaining Estimated Hours As At Date = 
var _date = CALCULATE(MAX('Remaining Estimate Changes'[DateModified]),  <= 'Remaining Estimate Changes'[DateModified] <= SELECTEDVALUE('Planning Calendar'[Date]) )

RETURN
CALCULATE(MAX('Remaining Estimate Changes'[Sum RemainingEstimatedHours]), 'Remaining Estimate Changes'[DateModified] = _date)

but it should be checked on your data model

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@az38 

 

Thanks for your reply...I've applied that Measure but it is giving an error.....

 

2020-04-02_15h57_33.png

@graemejohnson 

try MAXX()

Remaining Estimated Hours As At Date = 
var _date = CALCULATE(MAX('Remaining Estimate Changes'[DateModified]),  <= 'Remaining Estimate Changes'[DateModified] <= SELECTEDVALUE('Planning Calendar'[Date]) )

RETURN
CALCULATE(MAXX('Remaining Estimate Changes', 'Remaining Estimate Changes'[Sum RemainingEstimatedHours]), 'Remaining Estimate Changes'[DateModified] = _date)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

I first get this...

 

2020-04-02_16h21_29.png

 

 

Or (when I remove the <=) this...

 

2020-04-02_16h23_10.png

 

@graemejohnson 

sorry, it takes a long time as i have no possibility to debug by myself

Remaining Estimated Hours As At Date = 
var _date = CALCULATE(MAX('Remaining Estimate Changes'[DateModified]),  FILTER(ALL('Remaining Estimate Changes'), 'Remaining Estimate Changes'[DateModified] <= SELECTEDVALUE('Planning Calendar'[Date])) )

RETURN
CALCULATE(MAXX('Remaining Estimate Changes', 'Remaining Estimate Changes'[Sum RemainingEstimatedHours]), 'Remaining Estimate Changes'[DateModified] = _date)

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Thanks, it compiles without error but the results are not what I'd expect....

1) shows the new measure

 

2020-04-02_16h33_24.png

@graemejohnson 

try SUMX() not MAXX 

if it won't help, please, share your pbix-file


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Hi

 

I didn't work - will try and upload my .pbix

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors