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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
lapa44
Regular Visitor

Daily Delta Time Intelligence

Hi

 

I'm trying to figure out how to calculate daily changes (delta) in a time series. At the same time I need to be able to handle missing days and setting the value to zero on those days, and on the last day I also need to set the value to zero.

Here is an example of what a want to achieve:

 

Forum.PNG

In my dataset I have the black figures and I want to calculate the red ones. When setting Value = 0 in the end I only want a number on the first day after the last observation i.e. I only want numbers on 09-07-2018 and not 10-07-2018, 11-07-2018 etc.

The calculation needs to be applied on a trade level basis on a datasset of hundreds of trades.

Thanks in advance.

1 ACCEPTED SOLUTION
davehus
Memorable Member
Memorable Member

Hi @lapa44 - 

 

Without see a sample of the data, I'm making a few assumptions. If the dates with blanks are in your data set then you can use a find and replace to change the null values to zero in the query window. If there are specific days where you need the data to be 0, then you can create a seperate date table and merge with your fact table and create a conditional column to set the specific dates to 0

 

In terms of the delta change.. You can download a sample file here..

 

https://drive.google.com/file/d/14GpDdpFTgDL5NV73vHU7P20mJxVCxHPD/view?usp=sharing

 

Hope this helps.

 

D

View solution in original post

3 REPLIES 3
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @lapa44,

 

The solution of davehu should close your case.

 

If you have solved your problem, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please feel free to ask.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
davehus
Memorable Member
Memorable Member

Hi @lapa44 - 

 

Without see a sample of the data, I'm making a few assumptions. If the dates with blanks are in your data set then you can use a find and replace to change the null values to zero in the query window. If there are specific days where you need the data to be 0, then you can create a seperate date table and merge with your fact table and create a conditional column to set the specific dates to 0

 

In terms of the delta change.. You can download a sample file here..

 

https://drive.google.com/file/d/14GpDdpFTgDL5NV73vHU7P20mJxVCxHPD/view?usp=sharing

 

Hope this helps.

 

D

How are you, brother @davehus 

 

I saw your solution to the problem and I liked it, but I had a problem with the my data, which is that each date is repeated three times because of the column of Status I hope you help me plz

Country Last_Update       Incident_Rate           Status       Cases_Number   Previous Last_Update

Spain04/16/2020395.570224334054Recovered 04/15/2020
Spain04/16/2020395.570224334054Active18494804/15/2020
Spain04/16/2020395.570224334054Delta_Confirmed730404/15/2020
Spain04/16/2020395.570224334054Deaths1931504/15/2020
Spain04/15/2020379.948293204569Recovered 04/14/2020
Spain04/15/2020379.948293204569Active17764404/14/2020
Spain04/15/2020379.948293204569Delta_Confirmed510304/14/2020
Spain04/15/2020379.948293204569Deaths1870804/14/2020
 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors