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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Doliveira
Frequent Visitor

Line Chart by date

Hi everyone,

 

I'm trying to create a line chart with two lines, using the columns "Reported Date" and "Closed Date". Those columns have the date format "dd/mm/yyyy". The result of this chart should be the count of "Reported Date" and "Closed Date" for the last 15 days.

 

The problem is that when I put the Axys field as "Reported Date" (the only way I've found to put Date on X-Axys), and the Values field with "Count of Reported Date" and "Count of Closed Date", the line of "Closed Date" do not shows the correct value because the value it's not the same on "Reported Date". 

 

On the example below, the chart shows at day 03/08/2017 the line "Reported Date" with the count of 9, and the line "Reported Date" with the count of 3.

 

Example for the date "03/08/2017":

 

Sorting by Closed Date (11 rows):

 

Reported DateClosed Date
20/07/2017 10:5203/08/2017 17:58
28/06/2017 17:4803/08/2017 16:49
27/06/2017 10:1803/08/2017 16:44
03/08/2017 15:2903/08/2017 16:32
03/08/2017 08:4703/08/2017 12:57
03/08/2017 08:4103/08/2017 12:55
04/07/2017 15:4003/08/2017 11:28
25/07/2017 13:3903/08/2017 11:27
26/05/2017 12:3403/08/2017 11:26
31/01/2017 16:0003/08/2017 11:08
02/08/2017 09:2903/08/2017 09:04

 

Sorting by Reported Date (9 rows):

 

Reported DateClosed Date
03/08/2017 19:11 
03/08/2017 15:2903/08/2017 16:32
03/08/2017 13:45 
03/08/2017 13:23 
03/08/2017 10:16 
03/08/2017 10:07 
03/08/2017 09:11 
03/08/2017 08:4703/08/2017 12:57
03/08/2017 08:4103/08/2017 12:55

 

My english it's a little rusty, sorry for that.

 

Thanks

1 ACCEPTED SOLUTION
vanessafvg
Super User
Super User

@Doliveira

 

what you need to is create a date table

 

then you need to create 2 relationships to your date table

one from reported date to date

another from closed date to date

you will see the second one becomes a --- line that will be the inactive relationship

 

then you need to place your date from you date table on the visual

 

your first measure will be 

reported count = calculate(countrows(tablename))

closed count = calculate(countrows(tablename), userelationship(table[closeddate], datetable[date])

 

then you can plot both

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
vanessafvg
Super User
Super User

@Doliveira

 

what you need to is create a date table

 

then you need to create 2 relationships to your date table

one from reported date to date

another from closed date to date

you will see the second one becomes a --- line that will be the inactive relationship

 

then you need to place your date from you date table on the visual

 

your first measure will be 

reported count = calculate(countrows(tablename))

closed count = calculate(countrows(tablename), userelationship(table[closeddate], datetable[date])

 

then you can plot both

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Just amazing! Thank you very much! Work as requested!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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