Forum Discussion

ChenChristyYu's avatar
ChenChristyYu
Helper II
8 years ago
Solved

x-axis timeline

Hi experts,   I am new to PowerBI.  am trying to use the timeline as an x-axis in stacked area chart, and count how many projects are being done every minute. How should I set up the timeline down ...
  • v-yulgu-msft's avatar
    8 years ago

    Hi ChenChristyYu,

     

    You can create a calendar table using Power Query (New Source -> Blank Query). Then, create a relationship between this calendar table and your source table based on date/time field.

    let
        Source = Table.FromColumns({{Number.From(#date(2018,1,1))..Number.From(#date(2018,1,31))}}),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type date}}),
        #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each List.Times(#time(0, 0, 0), 48, #duration(0, 0, 30, 0))),
        #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom")
    in
        #"Expanded Custom"

     

    Best regards,

    Yuliana Gu