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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
ConnorH
Microsoft Employee
Microsoft Employee

Formatting Data for line chart

I have a status table which has a lot of rows of data similar to this:

 

Project IDStatus ExtractStatus Change DateCreated date
135683.07/15/207/10/20
135684.07/16/207/10/20
155981.07/18/207/16/20
155982.07/20/207/16/20
135683.07/20/207/10/20

 

I created a   of columns which hold values such as days from [1.0 to 2.3], [2.3 to 2.5], [2.5 to 3.0]. When I pull these values into a visual the only visual I can really use is a table and take the average of these numbers which is what I want. I would really like to figure out how to format this in another way so that I can use a line chart and have the Y-axis = days and the X-axis =  [1.0 to 2.3], [2.3 to 2.5], [2.5 to 3.0]. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ConnorH 

I think your datediff may be calculated between created date and status change date.

 

Datediff = DATEDIFF('Table'[Created date],'Table'[Status Change Date],DAY)
X axis = SWITCH(TRUE(),'Table'[Datediff]/'Table'[Status Extract]<=2.3,"[1.0 to 2.3]",'Table'[Datediff]/'Table'[Status Extract]<=2.5,"[2.3 to 2.5]","[2.5 to 3.0]")

 

1.png

Some datediffs >3.0, I let Datediff divide Status.

Could you show me your calculate logic to divide datediff into [1.0 to 2.3],[2.3 to 2.5],[2.5 to 3.0].

Then you can build a line chart by add X axis into axis and Datediff into values.

2.png

Best Regards,

Rico Zhou

 

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

4 REPLIES 4
Anonymous
Not applicable

Hi @ConnorH 

Could you tell me more details about your calculate logic?

Please show me:

1. What do [1.0 to 2.3], [2.3 to 2.5], [2.5 to 3.0] in the new column mean? Are they flags? If this column is a calculated column, please show me your dax and tell me your calculate logic about it.

2. What do days in Y axis mean? Are they datadiff between create and change dates?

3. Will we use Status Extract in our calculation?

4. You can show me a screenshot of the result you want or you can share your pbix file with me by your Onedrive for Business.

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

 

the [1.0 to 2.3], [2.3 to 2.5] and the [2.5 to 3.0] are all columns I created which hold number of days between the two status. I used a date diff to do so. I was asked if I could make this in to a line chart where I would have the Y-axis be number of days and then the first x-axis value being [AVG 1.0 to 2.3] and then have a line going to the next value which would be [AVG 2.3 to 2.5] and so on. 

Anonymous
Not applicable

Hi @ConnorH 

I think your datediff may be calculated between created date and status change date.

 

Datediff = DATEDIFF('Table'[Created date],'Table'[Status Change Date],DAY)
X axis = SWITCH(TRUE(),'Table'[Datediff]/'Table'[Status Extract]<=2.3,"[1.0 to 2.3]",'Table'[Datediff]/'Table'[Status Extract]<=2.5,"[2.3 to 2.5]","[2.5 to 3.0]")

 

1.png

Some datediffs >3.0, I let Datediff divide Status.

Could you show me your calculate logic to divide datediff into [1.0 to 2.3],[2.3 to 2.5],[2.5 to 3.0].

Then you can build a line chart by add X axis into axis and Datediff into values.

2.png

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

amitchandak
Super User
Super User

@ConnorH , why are not able use this column on x-axis as of now

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors