Forum Discussion
Moving Values of Several Rows within Column mostly empty to next Column
- Anonymous1 year ago
Hi Laosi ,
Thank you for reaching out to the Microsoft Fabric Community.
Your requirement is achievable in Power Query. You can restructure the summary rows (e.g., "Average PER", "Weighted Average PBV") from the Sector column into Stock Name, and move their corresponding values into the Assets column using the steps below:
Add a custom column to flag rows:
if Text.Contains([Sector], "PER") or Text.Contains([Sector], "PBV") then true else falseCreate new columns:
- New Stock Name:
if [IsSummaryRow] then [Sector] else [Stock Name]- New Assets:
if [IsSummaryRow] then [Assets] else [Assets]Once you’ve created the new columns, delete the original columns: Sector, Sub Industry Code, Stock Name, and Assets. Then rename your new columns to Stock Name and Assets. Make sure the data types are correct for example, text for names and numbers for values. These steps will clean up your data and remove the extra columns you don’t need.
If you still face issues after trying this, please share a sample of your data as suggested by lbendlin so we can help you further.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou.
Hi Laosi ,
Thank you for reaching out to the Microsoft Fabric Community.
Your requirement is achievable in Power Query. You can restructure the summary rows (e.g., "Average PER", "Weighted Average PBV") from the Sector column into Stock Name, and move their corresponding values into the Assets column using the steps below:
Add a custom column to flag rows:
if Text.Contains([Sector], "PER") or Text.Contains([Sector], "PBV") then true else false
Create new columns:
- New Stock Name:
if [IsSummaryRow] then [Sector] else [Stock Name]
- New Assets:
if [IsSummaryRow] then [Assets] else [Assets]
Once you’ve created the new columns, delete the original columns: Sector, Sub Industry Code, Stock Name, and Assets. Then rename your new columns to Stock Name and Assets. Make sure the data types are correct for example, text for names and numbers for values. These steps will clean up your data and remove the extra columns you don’t need.
If you still face issues after trying this, please share a sample of your data as suggested by lbendlin so we can help you further.
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thankyou.
Thank you for ur respond, i decided to move it manually in file sources so i can calculate market PER and PBV changing percentages as well, i`ll try it if i encounter same problem again in the future, any way thank you so much 🙏