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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
pjfiscus
New Member

Plotting 2 dates from same table onto line chart

Trying to create a line graph that looks like this:  

 desired graph.png

In the PBX I am building this is what mine looks like, only getting one line and the counts are the same.  I had 2 date tables, one for opened date, and one for closed date tied back to my ticket table.  Thought, maybe I need one date table to use for the Axis that is then tied to the Opened and Closed Date tables.  But this didnt fix it.  Why am I getting the same counts for open vs. closed date? 

incorrect graph.png

Here are the parameters for my Axis and Values I currently have setup on the line chart that is giving me the undesired result.

line graph params.png 

 

 

In my ticket table these are the 2 date columns: 

open and close dates on ticket table.png

I have in my Date table, the DateasInteger setup as a relationship to the same field in both the OpenedDate and ClosedDate tables.  The DateasInteger from the OpenedDate table is related to the OpenDateKey in the ticket table, and the DateasInteger field in the ClosedDate table is related to the CloseDateKey column in the ticket table.  Don't even know if I need the Date table, or if I should just be able to use the 2 different date tables.  But I have tried it both ways and I get the same result.  Why is counting the same number of tickets opened in a month as closed (I know they are not the same). 

table relationships.png

 

I know one option is to unpivot my ticket data so each ticket has a data row for the opened record and one for the closed record.  But then I can't use that graph on the same work area as all my other ticket graphs because the same slicers won't work for it as my other graphs (such as ticket assigned to employee).   

 

How do I fix this?

2 REPLIES 2
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @pjfiscus

 

You may try to use USERELATIONSHIP Function to create measures. Here are the references for you.

https://carldesouza.com/power-bi-dax-userelationship-multiple-dates/

https://www.sqlbi.com/articles/userelationship-in-calculated-columns/

 

Show a simplified sample as below:

First, You may try to create 2 relationships for calendar table and your ticket table. Then create measures for opendatekey and closedatekey.

3.png

3.png

CloseDateCount =
CALCULATE (
    COUNT ( Table7[CloseDateKey] ),
    USERELATIONSHIP ( Table7[CloseDateKey], 'calendar'[Column] )
)
OpenDateCount =
CALCULATE (
    COUNT ( Table7[OpenDateKey] ),
    USERELATIONSHIP ( Table7[OpenDateKey], 'calendar'[Column] )
)

1.png

Regards,

Cherie

 

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
pjfiscus
New Member

My screen cap above didnt show it by the YearQuarter field I am using as the Axis is fro the Date table (not the Opened or Closed Date tables)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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