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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
TK12345
Resolver I
Resolver I

CalculatedColumn Index

Hi,

Could someone help me with a calculated column index. 

I have the following data:

SortTestValueOutcome
1 11
2 12
3test02
4 13
5 14
6 15
7 16
8 17
9test07
10test07
11test07
12 18
13 19
14test09
15 110
16test010
17test010
18 111
19test011

 

Index needs to start with 1, if the column on the left is empty then I need +1 for the index column. I have tried the following:

Column = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Index]<=EARLIER('Table'[Index])))

But this was to heavy or something to calculate and it crashed. 

How do I need to do this with a calculated column? Needs to be calculated column because the other columns are calculated as well.

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

Hi @TK12345 ,

 

As far as I know, there should be a column as a condition for calculated index column, such as [Date],[Value]... and so on. I couldn't find a column which could be condition in your above table. Is [Sort] column a calculated index column in your table and your calculation is heavy or something to calculate and it crashed? I think calculation is based on data model, here I suggest you to try to optmize your data model or your code and try again.

For reference:

Optimization guide for Power BI - Power BI | Microsoft Learn

 

Best Regards,
Rico Zhou

 

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-rzhou-msft
Community Support
Community Support

Hi @TK12345 ,

 

As far as I know, there should be a column as a condition for calculated index column, such as [Date],[Value]... and so on. I couldn't find a column which could be condition in your above table. Is [Sort] column a calculated index column in your table and your calculation is heavy or something to calculate and it crashed? I think calculation is based on data model, here I suggest you to try to optmize your data model or your code and try again.

For reference:

Optimization guide for Power BI - Power BI | Microsoft Learn

 

Best Regards,
Rico Zhou

 

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

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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