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
BudMan512
Helper V
Helper V

How do I determine daily values from cumulative values in a table

I have created the included table containing a date range from 1/1/2014 to the present.

Cumulative Degree Days begin counting anew every July 1 and end June 30 and then repeats every 12 months.  That’s why the first screenshot shows 1326 degree days on Jan 1 and the second screenshot show it resetting on July 1.  Degree Days are used in the heating industry to help predict when a customer is due for a delivery, among other things.  The more degree days the more the furnace runs.

I am trying to determine the actual degree days that occurred each calenedar day.  In Excel its easy, add a third column and create a formula to subtract the cumulative DD for 1/1/14  from 1/2/14.  The difference is the degree days for 1/2/14.  In the included table that would be 34 degree days.  Then copy the formula down to 6/30/14 and start again every July 1.  So Excel I can do but I need some help with the DAX in Power BI.   I am new to Power BI but am taking some on line classes and haven’t gotten indepth with the DAX yet.  I would greatly appreciate any help given.  Thanks, Bud

BudMan512_0-1640298827962.png

BudMan512_1-1640298850302.png

 

 

11 REPLIES 11
Ashish_Mathur
Super User
Super User

Hi,

Assuming you have a Calendar Table which has a relationship with the Date column of your Data Table AND you have dragged the Date in your visual from the Calendar Table AND cumulative dgree days is a measure, write this measure

Measure = if(format(min(calendar[date]),"mmdd")="0701",[cumulative degree days],[cumulative degree days]-calculate([cumulative degree days],previousday(calendar[date])))

Hope this helps.

 


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

Hi Ashish I have added the date table and am using the date from that table in the visual.  However, the Cumulative Degree Day values were taken directly out of a table in our system and I need the daily values.  How would that affect the DAX you provided?  Thanks

Hi,

CDD = SUM(Data[cumulative degree days])

Degree days = if(format(min(calendar[date]),"mmdd")="0701",[CDD],[CDD]-calculate([CDD],previousday(calendar[date])))

Hope this helps.


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

Hi Ashish, thanks for hanging in there with me.  The measures are not working quite right.  The first year has problems and then when July 1 comes there is also a problem.  I have included screenshots and the DAX. Thanks

 

CDD = SUM(F_DEGREE_DAY[YTD Degree Days])

 

Degree Days- = IF(format(min('Date'[Date]),"mmdd")= "0701",[CDD],[CDD]-calculate([CDD], previousday('Date'[Date])))

BudMan512_0-1640701349564.pngBudMan512_1-1640701387123.png

 

 

 

Hi,

Ensure that you drag Date from the Calendar Table.  Also, replace CDD with YTD Degree Days.  My assumption is that YTD Degree Days is a measure.

Hope this helps. 


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

Hey,

'YTD Degree Days' is not a measure.  Values for that column come directly from the DegreeDay table.  So these measures aren't quite right.  I am trying to determine the daily values.  I am using the date field from the date table.

Thanks,

Bud

 

Hi,

I'll need to your file to work on.


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

Thanks Alexis I will check that out.

bcdobbs
Community Champion
Community Champion

Are you able to share a demo pbix file?

 

General principal is straight forward but needs care when the year rolls over.

 

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Sorry, I must not have permissions to share my file. 

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!

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.