Forum Discussion

lucaspisso0's avatar
lucaspisso0
Regular Visitor
1 year ago
Solved

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...
  • v-hashadapu's avatar
    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.