Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nareshr89
Helper II
Helper II

Adding rows to an existing table in Power BI

I have a table that is used to format the KPI to a specific buckets based on header and each KPI has a sorting order number. I would like to add new rows under multiple places and want the sorting order to update automatically.

Sample data below.

nareshr89_0-1651490728958.png

 

Ex - I want to add a KPI that should be inserted in the 3rd row and the sort order should be automatically updated for the below rows.

4 REPLIES 4
mork22
Regular Visitor

Go to "Transform Data"

Select the Query where you need to add a value (in my example "Custom Values")

Then click on the gear next to source

mork22_0-1704363994706.png

In the next screen you can add new values

mork22_1-1704364134301.png

Click OK to save the new values

 

v-yingjl
Community Support
Community Support

Hi @nareshr89 ,

To sort rows and re-sort them in Power Query Editor, first you need to clear that the logic to sort these rows initially, if the logic is not clear, perhaps using enter data like @ AlexisOlson would be a 'quick and dirty' solution.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AlexisOlson
Super User
Super User

One quick and dirty solution is to use 'Enter data' to create a new table with an intermediate index for the KPI and append that to your existing table.

 

AlexisOlson_0-1651513020652.png

(Column names abbreviated for readability. Use your actual column names.)

jNilsen
Regular Visitor

I assume the SortOrder_chr (rankChr) is fixed in a table and not counted as a relative position in that table.

Each rank is decided relative to the Attri_pnl_f before and after according to Attr.._sortOrder where the rankChr is set at regDate.

When you need to insert a new row there is no available chr's between rows (..."2,3,4"...) or you need to rewrite each rankChr one higher than the one you want to replace and continue the rankUp.

 

To solve this you can replace all Attr.._sortOrder with new chrSets like "aaa,aba,aca.." or "100,200,300..." which gives you space to insert new rows and assign a new relative rankChr.

AlfaNum will give you 25 rows for each chr, num will give you 9.

 

Also, you can create a table wih just [Attr.._format] and [Attr.._sortOrder] and update new rows and rewrite each rankUpChr there whitch you then use to insert the rank into this table.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors