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
Anonymous
Not applicable

Two Date Tables - One Related & One Disconnected - On Same Axis?

I am attempting to analyze to aspects of service tickets on a monthly trend: number of new tickets opened and number of tickets open at any time in that month. I'd like this represented on a combo chart (line/bar graph).

 

I have a fact table Tickets that contains a DateOpen and DateClosed field for each ticket. I have a date table connected to the DateOpen field to count the new tickets opened

NewTickets = COUNTROWS( Tickets[DateOpen])

To get the volume of tickets for a given month I use another date table that is not connected to the Tickets table and utilize the LASTDATE and FIRSTDATE functions to count whether the DateOpen and DateClosed values fall within a given month

CALCULATE(
        COUNTROWS( Tickets),
        FILTER(
            Tickets,
            Tickets[DateOpen] <= LASTDATE(tCalendarDisconnect[Date]) && 
            Tickets[DateClosed] >= FIRSTDATE(tCalendarDisconnect[Date]
        )
    )

As separate visuals this achieves what I want.

PBI Example.png

But what I want is to see this information on the same axis. Does anyone know of any methods that would allow me to do this (example, can I use the same date table for both of these formulas some how?) Any help is appreciated.

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @Anonymous 

Let's work with your second chart. Change your first measure's code to:

NewTickets = 
CALCULATE( COUNTROWS( Tickets), FILTER( Tickets, Tickets[DateOpen] <= LASTDATE(tCalendarDisconnect[Date]) && Tickets[DateOpen] >= FIRSTDATE(tCalendarDisconnect[Date]) ) 

 

View solution in original post

2 REPLIES 2
AlB
Super User
Super User

Hi @Anonymous 

Let's work with your second chart. Change your first measure's code to:

NewTickets = 
CALCULATE( COUNTROWS( Tickets), FILTER( Tickets, Tickets[DateOpen] <= LASTDATE(tCalendarDisconnect[Date]) && Tickets[DateOpen] >= FIRSTDATE(tCalendarDisconnect[Date]) ) 

 

Anonymous
Not applicable

@AlB  Thank you so much, that is exactly what I needed!

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.