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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
lucaspisso0
Regular Visitor

power bi

 

Hi guys, is it possible to transpose the values of the previous column? Currently I have managed to put the condition that if the progressive is 1 , i.e. the beginning, then return -, otherwise it should give me the value of the previous line. Help me pls!!

Screenshot 2025-03-24 172007.png

1 ACCEPTED SOLUTION
v-hashadapu
Community Support
Community Support

Hi @lucaspisso0 , Thank you for reaching out to the Microsoft Community Forum.

 

The most efficient and straightforward solution is to sort the visual by the Progressive column. Since PREVIOUS() relies on the visual order, sorting by Progressive guarantees that it pulls the value from the actual previous row. In Power BI Desktop -> Table visual -> dropdown arrow next to the Progressive column header -> Sort Ascending. Once the visual is properly sorted, use:
PreviousROB = PREVIOUS([ROB AT BERTHING MGO_SingleRow], HIGHESTPARENT)

 

If you want to make the formula more robust and independent of the visual’s sorting, you can explicitly specify the sorting column inside the PREVIOUS() function. This ensures that the function always references the previous row based on the Progressive column, regardless of how the visual is sorted. Use:
PreviousROB = PREVIOUS([ROB AT BERTHING MGO_SingleRow], HIGHESTPARENT, Table[Progressive])
By adding Table[Progressive] as the third parameter, you hardcode the sorting reference into the formula itself. This makes the calculation more reliable, even if the visual is later sorted differently or modified by the user.

 

If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.

View solution in original post

4 REPLIES 4
v-hashadapu
Community Support
Community Support

Hi @lucaspisso0 , Thank you for reaching out to the Microsoft Community Forum.

 

The most efficient and straightforward solution is to sort the visual by the Progressive column. Since PREVIOUS() relies on the visual order, sorting by Progressive guarantees that it pulls the value from the actual previous row. In Power BI Desktop -> Table visual -> dropdown arrow next to the Progressive column header -> Sort Ascending. Once the visual is properly sorted, use:
PreviousROB = PREVIOUS([ROB AT BERTHING MGO_SingleRow], HIGHESTPARENT)

 

If you want to make the formula more robust and independent of the visual’s sorting, you can explicitly specify the sorting column inside the PREVIOUS() function. This ensures that the function always references the previous row based on the Progressive column, regardless of how the visual is sorted. Use:
PreviousROB = PREVIOUS([ROB AT BERTHING MGO_SingleRow], HIGHESTPARENT, Table[Progressive])
By adding Table[Progressive] as the third parameter, you hardcode the sorting reference into the formula itself. This makes the calculation more reliable, even if the visual is later sorted differently or modified by the user.

 

If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.

lbendlin
Super User
Super User

consider using Visual Calculations - it has a PREVIOUS command and you can specify COLUMNS as the axis.

Great, thank you very much! I tried to use this formula, "PreviousROB = PREVIOUS ( [ROB AT BERTHING MGO_SingleRow],HIGHESTPARENT )" it seems to work, but not yet perfectly, should I also insert that the sorting is done on the basis of a progressive? Screenshot 2025-03-25 102651.png

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.