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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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