Forum Discussion
power bi
- 1 year ago
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.
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.