Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ChenChristyYu
Helper II
Helper II

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 to minutes within a certain period of time (e.g.: from January 1st to the end of January)? 

 

THANKS a lot.

 

Best,

Chen

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

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"

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

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"

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Gu,

 

Thanks for your reply. I am curious if I want to create a new table based on other queries in the same PowerBI project, what is the code format for the source? for example,  I want to create a new table called 'returns' selecting columns from table 'sales', how can I do it.

Sources = ...?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.