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
kressb
Helper V
Helper V

Adding a Row to a Created Table?

Hello,

I created a Table in PowerBI Desktop:

kressb_0-1626203626346.png

Table =
Filter(
Summarize(ExistingTable, ExistingTable[UniqueID1], ExistingTable[UniqueID1], ExistingTable[Name], ExistingTable[Number1], ExistingTable[Number2], Rollforward[Number3], ExistingTable[Number4], ExistingTable[Number5],ExistingTable[Notes], ExistingTable[Site], "StartDate", Min(ExistingTable[Start Date])),
CONTAINSSTRING(ExistingTable[Notes],"Abc"))
 
Now I need to add a Row that's outside the "ExistingTable"
Is there a way to add code to do this?
1 ACCEPTED SOLUTION

Hi @kressb ,

 

you can append more rows/tables with UNION.

https://dax.guide/union/

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


View solution in original post

7 REPLIES 7

Hi @kressb ,

 

you can append more rows/tables with UNION.

https://dax.guide/union/

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


@mwegener 

Yes, but I don't have any table to UNION them from.

IE the data exists only in my head and I want to enter it into the table

You could use the Enter data button to create a new table with the data in your head or else define it as a DATATABLE with DAX.

Hi @kressb ,

 

then you must create the table in the same structure with DATATABLE

https://docs.microsoft.com/en-us/dax/datatable-function

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


@AlexisOlson @mwegener 
Ok, so selected enter data, created another table with my manual data - used all the same columns in the exact same order and formated them all correctly.

went back to the original table I created. called that one var _Table1 and then set a Union:

Table =
var _Table1 = Filter(
Summarize(ExistingTable, ExistingTable[UniqueID1], ExistingTable[UniqueID1], ExistingTable[Name], ExistingTable[Number1], ExistingTable[Number2], Rollforward[Number3], ExistingTable[Number4], ExistingTable[Number5],ExistingTable[Notes], ExistingTable[Site], "StartDate", Min(ExistingTable[Start Date])),
CONTAINSSTRING(ExistingTable[Notes],"Abc"))
Return
Union (_Table1,SecondNewTable)
 
Columns between the 2 tables are not matching up.. why?

Update: read this thread: Union column order - Microsoft Power BI Community

Had to add a nested Summarize to the Second New Table to get it to work.. 

Seems like a lot more work than it should be...

Your second table needs to match the columns of the table you are unioning it with, not the original shape of the table you are summarizing. Having [UniqueID1] twice in your summary might make this problematic.

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.