The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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!!
Solved! Go to Solution.
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.
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?
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...
User | Count |
---|---|
28 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |