cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TK12345
Helper II
Helper II

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
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors