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
Anonymous
Not applicable

Creating calculated column that references itself (or workarounds to it)

Hi, quite new to Power BI and still have that excel mentality. Am trying to create a calculated column "CB", is there any workaround available that can get values just like column CB? Kind thanks.

 

kohno71_0-1656055001392.png

 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

In Power BI, it is not able to refer to itself when creating a calculated column. We need to convert it to calculating some kind of cumulative sum instead if possible. 

 

You can create other three columns with below code. However, I cannot figure out how to calculate CB with DAX. 

Amount(USD) = 'Table'[Price]*'Table'[Units]
Buy/Sell = IF('Table'[Units]>0,"Buy","Sell")
Running today = SUMX(FILTER('Table','Table'[DealingDate]<=EARLIER('Table'[DealingDate])),'Table'[Units])

 

Best Regards,
Community Support Team _ Jing

View solution in original post

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

In Power BI, it is not able to refer to itself when creating a calculated column. We need to convert it to calculating some kind of cumulative sum instead if possible. 

 

You can create other three columns with below code. However, I cannot figure out how to calculate CB with DAX. 

Amount(USD) = 'Table'[Price]*'Table'[Units]
Buy/Sell = IF('Table'[Units]>0,"Buy","Sell")
Running today = SUMX(FILTER('Table','Table'[DealingDate]<=EARLIER('Table'[DealingDate])),'Table'[Units])

 

Best Regards,
Community Support Team _ Jing

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.