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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Nourhassan
Helper I
Helper I

Calculate Change by previous row value

Hello,

 

I need to calculate the load change hourly, so how the load is changed from time to time per percentage like the table below. 

 

LoadChange.png

I have a table with a TIME (From 0 to 23) Column and Load value. Based on that i need to calculate the change in percentage. The Load Change in Time 0 should be here empty like shown in the above screenshot. The load change in Time 1:00 was calculated here as  follows: [(1963.935 - 1986.167) / 1963.935]. 

 

LoadChange.png

 

Thank you in advance.

 

23 REPLIES 23
Nourhassan
Helper I
Helper I

Hello, 

 

Is it possible to add this column to another table without any relationship?

I don't understand what you are trying to accomplish. Please elaborate.

I have these two tables below:

 

Nourhassan_1-1646136027691.png

 

Nourhassan_2-1646136055484.png

 

I have a Report with a new Calculation, named "Expected Demand" which multiply the "Load Change" from Table DailyLoad with "Switch_MW"  from Table ENS. Both tables are not in relationship. I don't know how to handle this. 

 

Expected Demand (MW)
Switch MW*Load change %

 

The Load change in the Calculation "Expected Demand" has to be chosen from the correct timezone in Table dailyload.

 

It is more clear now?

 

 

 

The new column has to be added to ENS Table.

Either you find a relationship (a column that matches between the tables) or you use LOOKUPVALUE() if a relationship cannot be determined.

I don't have any column that can build a relationship between the tables, so I need to use LOOKUPVALUE(). Can you help me with how to use it in this case?

I have no expertise in using LOOKUPVALUE. I try to avoid using that function, and prefer to have a solid data model to work with.

Nourhassan
Helper I
Helper I

To know to which date the data is from. Maybe, later the dataset will be extended with other dates too. Then I can compare both dates with each other. 

I added the date column.  Not sure what added value it provides. See attached.

 

 

Thank you for your help. I really dont know what the problem is. This is my table below:

 

Loadtable.png

 

 

 

Is your table called 'Table' or something else?

Something else, but I have been changed it also in the measure. 

Nourhassan
Helper I
Helper I

hello @lbendlin,

 

is that helpful? Or do you need it as excel file?

 

R_TIMELOAD
0795
1724
2697
3677
4667
5658
6734
7692
8707
9728
10756
11766
12764
13730
14725
15780
16779
17781
18881
19860
20838
21837
22837
23811

 

Thank you for providing sample data.  Something like this?

 

lbendlin_0-1644266292070.png

see attached

I think you have made a mistake with the number to divide. The dividend should be the first number of Subtraction (Minuend).

I don't think so.  Value growth computations generally follow the pattern 

 

(New Value minus Old Value) divided by Absolute of Old value

Also, when I put this measure in my table, then I got an empty column without error. 

Can someone help me please? I don't know why the column is blank

My proposed solution is based on the sample data you provided.  If the sample data does not cover the issue fully then please provide more descriptive sample data.

Unfortunately, I don't have permission to upload the .pbix file here. 

Kindly find below a table with more data. 

 

R_DATER_TIMELOAD
12/01/20210795
12/01/20211724
12/01/20212697
12/01/20213677
12/01/20214667
12/01/20215658
12/01/20216734
12/01/20217692
12/01/20218707
12/01/20219728
12/01/202110756
12/01/202111766
12/01/202112764
12/01/202113730
12/01/202114725
12/01/202115780
12/01/202116779
12/01/202117781
12/01/202118881
12/01/202119860
12/01/202120838
12/01/202121837
12/01/202122837
12/01/202123811

 

The problem only occurs when the date column is added. I think the problem is that it is the same day in each row.

 

 

 

Your sample data is not fully covering your issue.  Provide at least two days'  worth of hourly snapshots.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.