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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
GoingIncognito
Advocate III
Advocate III

Visualizing with dates from changelog

Hi all ya!


This should be a easy task, yet  I manage to fail at it. So.

My data comes from Jira. And jira all the changes to data are saved to the changelog. So as one ticket progress from Open to Closed it gets a timestamp on each step it takes. I want to use datetimes from the changelog when visualizing using a column chart. My column chart has year/quarter from the calendar table as it's axis. Yes, the calendar is the whole thing with bells and whistles provided by Radacad - what a hero! 

So my data has columns for key, created (datime), change created (datime), changed from(value) and changed to (value).

 

Now what I want to measure is:
1 New tickets= Count of tickets opened that particular quarter
2 Old tickets = Count of tickets that were opened on any of the previous quarters but not yet closed

3 Closed tickets = Count of tickets closed on that quarter

 

I figured it the logic would be something like this? Yet, I'm not sure about the numbers I get.

(Measure) [New tickets] =
var Beginning = STARTOFQUARTER(Kalenteri[Date])

var End =  ENDOFQUARTER(Kalenteri[Date])

return

CALCULATE( DISTINCTCOUNTNOBLANK(Data[key]),

    FILTER(Data,
  Data[issuetype] = "<foo>" &&

     (Beginning >= Data[Created] && End <= Data[Created])

    )

)

 

(Measure) [Old tickets] =

var Beginning = STARTOFQUARTER(Kalenteri[Date])

var End =  ENDOFQUARTER(Kalenteri[Date])

var PrevQ = calculate( quarter( min(Data[change created])), filter( data, Data[changed field] = "Status")) **

return

CALCULATE( DISTINCTCOUNTNOBLANK(Data[key]),

    FILTER(Data,
    Data[issuetype] = "<foo>" &&

    quarter(Data[change created]) > PrevQ 
    )

)

** Changed field equaling status makes sure that the datetime returned is for status; not e.g. a comment or something other irrelevant on this case.

 

(Measure) [Closed tickets] =
var Beginning = STARTOFQUARTER(Kalenteri[Date])

var End =  ENDOFQUARTER(Kalenteri[Date])

return

CALCULATE( DISTINCTCOUNTNOBLANK(Data[key]),

    FILTER(Data,

      Data[issuetype] = "<foo>"
      && (Beginning >= Data[change created] && End <= Data[change created])

      && Data[changelog changed to] in {"Done", "Closed"}

    )    

)


Any ideas how off the mark I am? Thank you guys!

1 REPLY 1
amitchandak
Super User
Super User

@GoingIncognito , Seems like very similar to HR blog. Create two date columns without timestamp to join with date table

 

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.