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
mamoormasoomi
Helper I
Helper I

Compare text rows and return result in numeric

Hello, 

Please check the below screenshot and help me to resolve this issue.

Power BI.jpg

1 ACCEPTED SOLUTION
Eric_Zhang
Employee
Employee


@mamoormasoomi wrote:

Hello, 

Please check the below screenshot and help me to resolve this issue.

Power BI.jpg


@mamoormasoomi

To get the expected output, the first step is sorting by Key1 ascending and adding an index column to determine the rows order.

Capture.PNG

 

Then create a calculated column

Result Key = 'Table'[Index]-MINX(FILTER('Table',EARLIER('Table'[Key1])='Table'[Key1]),'Table'[Index])+1

Capture.PNG

 

See more details in the attached pbix file.

View solution in original post

1 REPLY 1
Eric_Zhang
Employee
Employee


@mamoormasoomi wrote:

Hello, 

Please check the below screenshot and help me to resolve this issue.

Power BI.jpg


@mamoormasoomi

To get the expected output, the first step is sorting by Key1 ascending and adding an index column to determine the rows order.

Capture.PNG

 

Then create a calculated column

Result Key = 'Table'[Index]-MINX(FILTER('Table',EARLIER('Table'[Key1])='Table'[Key1]),'Table'[Index])+1

Capture.PNG

 

See more details in the attached pbix file.

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.