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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
daan1887
New Member

Calculate with previous row values row by row

Hi everybody,

 

we are currently struggling with a row by row calculation with relative values.

 

The data basis is the following:

ProductDateDevelopmentToPreviousDate
101.01.20180%
102.01.201850%
103.01.201810%
104.01.2018-50%
105.01.201825%
106.01.201810%
107.01.2018100%
202.01.20180%
204.01.201810%
205.01.201825%

 

We want to calculate the Development of a product but we only have Percentage values that tell us how the product developed from one day to another.

The idea is to assign a value like 100 as a starting point to each product (whenever the product showed up in our data the first time) and then calculate from this value on ongoing row by row to monitoring the development since day one.

Example:

ProductDateDevelopmentToPreviousDateValue
101.01.20180%100
102.01.201850%150
103.01.201810%165
104.01.2018-50%82,5
105.01.201825%103,125
106.01.201810%113,4375
107.01.2018100%226,875
202.01.20180%100
204.01.201810%110
205.01.201825%137,5

 

 

Do you guys have an idea how to solve this in PowerBI?

 

 

Thank you Man Happy

Daniel

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@daan1887,

 

You may use PRODUCTX Function to add a calculated column.

Column =
PRODUCTX (
    FILTER (
        Table1,
        Table1[Product] = EARLIER ( Table1[Product] )
            && Table1[Date] <= EARLIER ( Table1[Date] )
    ),
    Table1[DevelopmentToPreviousDate] + 1
)
    * 100
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@daan1887,

 

You may use PRODUCTX Function to add a calculated column.

Column =
PRODUCTX (
    FILTER (
        Table1,
        Table1[Product] = EARLIER ( Table1[Product] )
            && Table1[Date] <= EARLIER ( Table1[Date] )
    ),
    Table1[DevelopmentToPreviousDate] + 1
)
    * 100
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.