Forum Discussion
Project Table linking to Dates Table
Anonymous ,
Could you please show some sample data and clarify more details?
Regards,
Jimmy Tao
Here is my data:
Projects(in 2 pics, one table tho)
let
Source = Excel.Workbook(File.Contents("Requests.xlsx"), null, true),
Requests_Sheet = Source{[Item="Requests",Kind="Sheet"]}[Data],
#"Filtered Rows" = Table.SelectRows(Requests_Sheet, each ([Column1] <> null)),
#"Promoted Headers" = Table.PromoteHeaders(#"Filtered Rows", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Project Name", type text}, {"Day Drafting will Begin", type date}, {"Day Drafting Needed by", type date}, {"Total Number of Drawings", Int64.Type}, {"Overall Estimated Time(in hours)", type number}, {"Requester", type text}, {"Request Timestamp", type datetime}}),
#"Invoked Custom Function" = Table.AddColumn(#"Changed Type", "Work Days Between", each #"Work Days"([Day Drafting will Begin], [Day Drafting Needed by])),
#"Added Custom" = Table.AddColumn(#"Invoked Custom Function", "Average Time By Day(Hours)", each [#"Overall Estimated Time(in hours)"]/[Work Days Between]),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"Average Time By Day(Hours)", type number}, {"Work Days Between", Int64.Type}})
in
#"Changed Type1"
Dates:
let
Source = List.Dates(#date(2019, 5, 1), 365, #duration(1, 0, 0, 0)),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "Date"}}),
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Date", type date}}),
#"Inserted Year" = Table.AddColumn(#"Changed Type", "Year", each Date.Year([Date]), Int64.Type),
#"Inserted Month Name" = Table.AddColumn(#"Inserted Year", "Month Name", each Date.MonthName([Date]), type text),
#"Inserted Day Name" = Table.AddColumn(#"Inserted Month Name", "Day Name", each Date.DayOfWeekName([Date]), type text),
#"Filtered Rows" = Table.SelectRows(#"Inserted Day Name", each ([Day Name] <> "Saturday" and [Day Name] <> "Sunday")),
#"Inserted Date" = Table.AddColumn(#"Filtered Rows", "Date.1", each DateTime.Date([Date]), type date),
#"Renamed Columns1" = Table.RenameColumns(#"Inserted Date",{{"Date.1", "Date Only"}}),
#"Removed Columns" = Table.RemoveColumns(#"Renamed Columns1",{"Date Only"})
in
#"Removed Columns"
Report:
So my goal is to use a relationship(I have none right now) to link the graph from dates and the table from projects so clicking one shows contribution from the other
Hopefully this is what you wanted, Thank you!
- v-yuta-msft7 years agoCommunity Support
Anonymous ,
You need to build an addtional column in both project and date table. Then create relationshio between the two tables based on the new columns. Make sure one of the new column should contain unique value.
Regards,
Jimmy Tao