cancel
Showing results for 
Search instead for 
Did you mean: 
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
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors