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
THENNA_41
Post Partisan
Post Partisan

Generate number series based on other column number first number change

I want Generate Number based on ther other column first number 1 chanage . attached sample input Data for reference 

 

Table 

task  task number
dd         1
ww        2
qw        3
ty         4
yu        5

 

if Number 1 changed to 2 order output look like

task task number calcaulted column
dd             2               2
ww           2                3
qw           3                4
ty          4                   5
yu        5                    6


if Number 1 changed to 3 order output look like

task task number calcaulted column
dd         3                       3
ww       2                        4
qw      3                        5
ty       4                        6
yu       5                        7

if Number 1 changed to 4 order output look like

task      task number       calcaulted column
dd           4                             4
ww          2                             5
qw         3                              6
ty          4                              7
yu        5                              8.

 

 

attached Sample Data Sample  

 
Thanks in advance . Looking For support
 
1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @THENNA_41 

 

You can try the following methods.

Column = 
Var _first=CALCULATE(MAX('Table'[task number]),FILTER('Table',[Index]=1))
Return
IF([Index]=1,[task number],CALCULATE(COUNT('Table'[task]),FILTER('Table',[Index]<EARLIER('Table'[Index])))+_first)

vzhangti_0-1699259217560.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @THENNA_41 

 

You can try the following methods.

Column = 
Var _first=CALCULATE(MAX('Table'[task number]),FILTER('Table',[Index]=1))
Return
IF([Index]=1,[task number],CALCULATE(COUNT('Table'[task]),FILTER('Table',[Index]<EARLIER('Table'[Index])))+_first)

vzhangti_0-1699259217560.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

wdx223_Daniel
Super User
Super User

CalculatedColumn=VAR _start=MAXX(TOPN(Table,Table[task],ASC),Table[task number]) RETURN COUNTROWS(FILTER(Table,Table[task]<EARLIER(Table[task])))+_start

 I got Error  cannot  find the type  task priority                                                                                                               

THENNA_41_0-1698978903066.png

 

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.