Forum Discussion
Create colum with the difference of two rows
- 3 years ago
Hi,
You may download my PBI file.
Hope this helps.
Hi,
Will there be a row for each day (without anyday being missed)? While this can be done using Power Query, the solution would be difficult to author if there are many Motors i.e. columns because one will have to create a calculated column for each motor. How many motor columns do you have?
- JoaoMS3 years ago
Helper III
Hi Ashish_Mathur , indeed, everyday the table will increase one row with data of at least 12 motors. So we'll need to create 12 new columns with the daily operating hours.
Thanks,
- Ashish_Mathur3 years ago
Super User
So that is then a convincing reason to not do it in the Query Editor because you will have to create those columns manually. You should do this via a measure directly in the visual.
- JoaoMS3 years ago
Helper III
Hi Ashish_Mathur , so you mean that it is more complicated to create these new columns in Power Query, because what we currently do is manually calculate these data in the source excel file, and then in Power Query we treat the data (unpivot and pivot) in order to get the following table and then easily create some visualizations:
Date Motor Daily Hour Acc. Hours 28/04/2023 Motor 1 - 15,400 28/04/2023 Motor 2 - 8,752 29/04/2023 Motor 1 24 15,424 29/04/2023 Motor 2 12 8,764 30/04/2023 Motor 1 4 15,428 30/04/2023 Motor 2 21 8,785 Thanks,
Joao