The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
How would you go about adding a row to the table below with the following data using only DAX?
location: New York
Type: Big
date: april, 2017
# people: 1000
Table 1
Location | Type | date | # people |
calgary | Big | march, 2017 | 1143 |
toronto | Small | march, 2017 | 242 |
california | Small | march, 2017 | 609 |
mogadishu | Big | march, 2017 | 0 |
Solved! Go to Solution.
Hey,
basically it's not possible to add rows to a table using DAX, for this reason I would recommend to add the new data to the data source of your "Table 1".
You can use DAX to create a new table, a calculated table, like so (Modeling Menu --> Calculations ribbon --> "New Table"):
new table = UNION( 'Table 1' , ROW( "location", "New York" ,"Type", "Big" ,"date", "april, 2017" ,"# people", 1000 ) )
Wondering you get the data to your "Table 1"?
If you entered the data using "Enter Data", you can add data to the data by opening the Query Editor, by using the "Edit Queries" from the "External Data" ribbon on your home menu. Then just click the gear icon right to the source step.
Hopefully this is what you are looking for.
Regards
Tom
Hey,
basically it's not possible to add rows to a table using DAX, for this reason I would recommend to add the new data to the data source of your "Table 1".
You can use DAX to create a new table, a calculated table, like so (Modeling Menu --> Calculations ribbon --> "New Table"):
new table = UNION( 'Table 1' , ROW( "location", "New York" ,"Type", "Big" ,"date", "april, 2017" ,"# people", 1000 ) )
Wondering you get the data to your "Table 1"?
If you entered the data using "Enter Data", you can add data to the data by opening the Query Editor, by using the "Edit Queries" from the "External Data" ribbon on your home menu. Then just click the gear icon right to the source step.
Hopefully this is what you are looking for.
Regards
Tom
Thank you Tom!
"gear icon right to the source step" - I would never have worked that out as the way to add another row to a table of data I manually entered!!!