Forum Discussion
Pivot...UnPivot??? How to fix this bad data setup
- 1 year ago
Use this. That line was not needed.
let Source =Table.FromRows(Excel.CurrentWorkbook(){[Name="Table2"]}[Content]), Custom1 = [a = List.Skip(Table.ToColumns(Source)), b = {a{0}} & {a{3}} & {a{1}} & {List.Skip(a{1}) & {null}}, c = Table.FromColumns(b, {"Parent ID", "Event","Start Date", "End Date"}) ][c] in Custom1 - 1 year ago
I think what yoy are asking for is result for a group of Parent ID. Then use this
let Source =Table.FromRows(Excel.CurrentWorkbook(){[Name="Table2"]}[Content]), Custom1 = Table.Combine(Table.Group(Source, {"ParentId"}, {"All", each [a = List.Skip(Table.ToColumns(_)), b = {a{0}} & {a{3}} & {a{1}} & {List.Skip(a{1}) & {null}}, c = Table.FromColumns(b, {"Parent ID", "Event","Start Date", "End Date"}) ][c]})[All]) in Custom1
Maybe now you are ready to follow my recommendations? We've been through the same exercise before in our company and have successfully solved it.
Okay, Mr. Super User: If I could follow your recommendation I would give it a try. But I do not have the faintest idea how to implement it. I am an advanced beginner (maybe intermediate) user of Power Query. And your replies have been well and truly way over my head.
And, from what I could make sense of, your solution involved getting the data directly from SF. I do not want to get all that data without filtering it. It is HUGE.
We are currently pulling the SF object (application history) into Excel power query, and performing what filtering we can. Then an MS Access database links to the query. From there we created a make-table query to aggregate the data for the minimum Approved date. Then we use the new table to filter the original history (by ParentId) to only history items for applications with an approved date in the history.
It is from this point we need to figure out the dates an Application was in Submitted Status (start and end dates), and calculate the business days for each event.
Why are we using Ms Access and Excel and not Power BI? Because we work for state govenment. We just got Power BI this year. None of us are skilled enough to use it or had any formal training with it. I have only dabbled with Excel's data model and have created some simple DAX expressions and power pivots.
So here we are jumping through hoops using the ancient tools we have to move giant data.
The requestor wants a table of raw data along with the summary. And it has to be in Excel format.
Columns:
- App No
- App Type
- First Submitted Date
- Final Submitted Date
- Time in Submitted Status (this is where we need to create a table of Start and End Dates to determine the number of business days between each event and then total those sums.)
There are more columns, but it is pointless to go on any further.
So, if you have any helpful to add, it would be appreciated. In the meantime, please do not scold me. I did not intentionally ignore you. I just did not understand wth you are asking me to do.