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.
consider using Visual Calculations - it has a PREVIOUS command and you can specify COLUMNS as the axis.
- lucaspisso01 year agoRegular Visitor
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?
- lbendlin1 year ago
Super User
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-Forum/ba-p/963216
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523