Forum Discussion

rakelvillanueva's avatar
rakelvillanueva
Regular Visitor
1 year ago
Solved

help calculation

First of all, please excuse my lack of knowledge in making this inquiry.

I have two tables, one for open tickets and another for closed tickets, and a table of dates (calculate dates).

I have a display with averages of open and resolved tickets, but I want to calculate the number of tickets that are open on a given date. However, no matter how many formulas I try, it doesn't work.

 

 

 

 

 

I have tried several formulas, including this one, but it does not calculate correctly.

Prueba = VAR FechaSeleccionada = SELECTEDVALUE(Fechas[Date])
RETURN
CALCULATE(
COUNTROWS(TICKETS_ABIERTOS),
TICKETS_ABIERTOS[Apertura] <= FechaSeleccionada,
OR(
ISBLANK(TICKETS_ABIERTOS[Resolucion]),
TICKETS_ABIERTOS[Resolucion] >= FechaSeleccionada

)

I am also unable to generate a visual table that filters by the result of this measurement.

12 Replies

  • v-hjannapu's avatar
    v-hjannapu
    Community Support

    Hi rakelvillanueva,

    Thank you  for reaching out to the Microsoft fabric community forum.

    I would also take a moment to thank wardy912 , techies, Greg_Deckler for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

    See if your Date table is marked as a Date Table and linked properly to the ticket table using the Opened Date and If the  closed / resolution Date is in another table, make sure both tables are related correctly so the formula can read both dates.

    First test the formula without any slicers or extra filters. If it gives correct results, then try adding your group slicer.

    If it still doesn’t work with the group slicer, the formula may need a small change so it keeps that filter active.

    Hope this helps if you have any queries we are  happy to assist you further.
    Best Regards,
    Harshitha.

    • rakelvillanueva's avatar
      rakelvillanueva
      Regular Visitor

      I have three tables:
      1. Open ticket
      2. Closed ticket
      3. Dates

      The dates table is marked as dates and linked to Open ticket and Closed ticket via an opening date and resolution date field.

    • rakelvillanueva's avatar
      rakelvillanueva
      Regular Visitor

      I'm testing this, but I would like to add a filter to the formula for a field I have for groups and a slicer so I can filter.

    • rakelvillanueva's avatar
      rakelvillanueva
      Regular Visitor

      I'm testing this, but I would like to add a filter to the formula for a field I have for groups and a slicer so I can filter.

  • Hi rakelvillanueva please try this

     

    Tickets Open on Date =
    VAR FechaSeleccionada =
        SELECTEDVALUE('date'[Date])
    RETURN
    CALCULATE(
        COUNTROWS(Merge1),
        FILTER(
            ALL(Merge1),  
            Merge1[Apertura] <= FechaSeleccionada &&
            (
                ISBLANK(Merge1[TICKETS_CERRADOS.Resolucion]) ||
                Merge1[TICKETS_CERRADOS.Resolucion] > FechaSeleccionada
            )
        )
    )
     
     
     
    • rakelvillanueva's avatar
      rakelvillanueva
      Regular Visitor

      I have tried that solution several times and it has not worked for me.

  • Hi rakelvillanueva 

     

     Ticket backlog was a pain for me to.

    Here's the DAX I used (Obviously, add your tables and columns):

     

    Incident Backlog = 
    VAR CurrentDate = MAX('Date'[Date])
    VAR ActiveTickets =
    CALCULATE(DISTINCTCOUNT(Incidents[Number]),
    ALL('Date'),
    'Date'[Date]<=CurrentDate,
    ISBLANK(Incidents[Resolved Date])
    ||Incidents[Resolved Date]>=CurrentDate)
    Return
    ActiveTickets

     

    I hope this helps!

    • rakelvillanueva's avatar
      rakelvillanueva
      Regular Visitor

      I have tried that solution several times and it has not worked for me.

      • wardy912's avatar
        wardy912
        Super User

        Can you show me your version please?

        If you've swapped out the tables/columns for yours there shouldn't be an issue. Do you have an active relationship between your date table and opened date?