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
Anonymous
Not applicable

Add dynamic rows for each day

How to add dynamic rows for each day with the processor name as Tom, activity as Login, Quarter Hour as 7:15:00AM and activity duration as 25200 for the attached table? The same details should be added for each day of the month except weekends.

 

image.png

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @Anonymous 

We can use PowerQuery and just do a couple transformations to get what you are looking for.

  • Reference the original table
  • Keep only 1 row for each unique date
  • Add the day name column and delete the weekend days
  • Use extract first 0 characters to clear all the data in the other columns
  • Fill in the Tom data
  • Append on the original table

I have saved an excel file example with the source data and the output table here: https://www.dropbox.com/s/y7109sh0ur9218x/AddTomRows.xlsx?dl=0

Original dataOriginal dataTom + original dataTom + original data

View solution in original post

4 REPLIES 4
jdbuchanan71
Super User
Super User

Hello @Anonymous 

We can use PowerQuery and just do a couple transformations to get what you are looking for.

  • Reference the original table
  • Keep only 1 row for each unique date
  • Add the day name column and delete the weekend days
  • Use extract first 0 characters to clear all the data in the other columns
  • Fill in the Tom data
  • Append on the original table

I have saved an excel file example with the source data and the output table here: https://www.dropbox.com/s/y7109sh0ur9218x/AddTomRows.xlsx?dl=0

Original dataOriginal dataTom + original dataTom + original data

v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

No, power query doesn't suppot adding specific rows, you can only append multiple tables in power query. In your senario, I would suggest you to export the data to database and insert rows using SQL statement like INSERT INTO TABLE VALUES(...).

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Would this logic work? @v-yuta-msft 

 

image.png

@Anonymous ,

 

This is DAX function, not the power query code. The dax code you provided can only generate a temporary table in the report view level. So if you don't need to add rows in the raw table, you can use DAX fucntion.

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.