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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

How can I use values in the same column for a calculation?

Here's some sample data to illustrate my problem:

 ABCD
1 ValuePct%RetIndex
201-Aug750,000 100
302-Aug759,0001.01101.2
403-Aug780,0001.03104
504-Aug740,0000.9598.66667

 

The Pct%Ret column is calculated by dividing the most recent value by the previous value (so for C3 was calculated by B3/B2). Since there is no previous value on Aug 01, then Pct%Ret is blank. 

For the Index column, the first value is always 100 (so this is a fixed value). The subsequent values are calculated by getting the previous day's index value and multiplying it by the current day's Pct%Ret. So for D3 = D2 * C3 and D4 = D3 * C4.

I have already created the Pct%Ret column, but i'm unsure how to use the values in the same column as it is returning an error. How can I complete this in PowerBI?

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

Hi , @Anonymous 

According to your description, you want to productx the [Pct %] measure and your default value is 100.

Here are the steps you can refer to :
(1)This is my test data :

vyueyunzhmsft_0-1692929665429.png

 

I create the [Pct %] measure to simulate your situation:

vyueyunzhmsft_1-1692929695617.png

(2)Then we can just create a measure like this:

Index = var _default = 100 
 var _t = ADDCOLUMNS( ALLSELECTED('Table'[Date]) , "Pct" ,  IF( [Pct%]=BLANK() ,1, [Pct%]))
 var _t2 = FILTER(_t , [Date]<= MAX('Table'[Date]))
 return
PRODUCTX(_t2 , [Pct])*_default

 

Then we can put this measure on the visual and we can meet your need , the result is as follows:

vyueyunzhmsft_2-1692929742769.png

 

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

6 REPLIES 6
v-yueyunzh-msft
Community Support
Community Support

Hi , @Anonymous 

According to your description, you want to productx the [Pct %] measure and your default value is 100.

Here are the steps you can refer to :
(1)This is my test data :

vyueyunzhmsft_0-1692929665429.png

 

I create the [Pct %] measure to simulate your situation:

vyueyunzhmsft_1-1692929695617.png

(2)Then we can just create a measure like this:

Index = var _default = 100 
 var _t = ADDCOLUMNS( ALLSELECTED('Table'[Date]) , "Pct" ,  IF( [Pct%]=BLANK() ,1, [Pct%]))
 var _t2 = FILTER(_t , [Date]<= MAX('Table'[Date]))
 return
PRODUCTX(_t2 , [Pct])*_default

 

Then we can put this measure on the visual and we can meet your need , the result is as follows:

vyueyunzhmsft_2-1692929742769.png

 

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Ashish_Mathur
Super User
Super User

Hi,

Do you want a "measure" or a "calculated column" formula solution?


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

I would like a calculated column solution, please. I plan to create an Indexed chart with base 100

Hi,

This calculated column formula works

Growth (%) = DIVIDE(Data[Value],CALCULATE(MAX(Data[Value]),FILTER(Data,Data[Date]=MIN(Data[Date]))))

Hope this helps.

Ashish_Mathur_0-1692931906837.png

 


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

@Anonymous , You can use ealier

 

Example

New column=

var _max = maxx(filter(Table, [A] < earlier([A]) ), [A])

return

divide([B],  sumx(filter(Table, [A] = _max), [B]) )

 

Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

I've tried using EARLIER(), here is my code for the Index column.

Index = 
VAR BaseValue = 100
VAR Multiplier = NLV[Pct%Ret]
VAR CurrentRow = NLV[Row]
RETURN
    IF(
        CurrentRow = 1185,
        BaseValue,
        EARLIER([Index]) * Multiplier
    )

 

However, the error it gives me is "EARLIER/EARLIEST refers to an earlier row context which doesn't exist.". Any idea how to calculate the Index column using the calculated values in the same column?

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.