The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Trying to create a line graph that looks like this:
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?
Here are the parameters for my Axis and Values I currently have setup on the line chart that is giving me the undesired result.
In my ticket table these are the 2 date columns:
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).
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?
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.
CloseDateCount = CALCULATE ( COUNT ( Table7[CloseDateKey] ), USERELATIONSHIP ( Table7[CloseDateKey], 'calendar'[Column] ) )
OpenDateCount = CALCULATE ( COUNT ( Table7[OpenDateKey] ), USERELATIONSHIP ( Table7[OpenDateKey], 'calendar'[Column] ) )
Regards,
Cherie
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)