Forum Discussion
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.
rakelvillanueva Have a look at this, I created this specifically for the purpose you are describing:
12 Replies
- v-hjannapuCommunity 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.- rakelvillanuevaRegular Visitor
I have three tables:
1. Open ticket
2. Closed ticket
3. DatesThe dates table is marked as dates and linked to Open ticket and Closed ticket via an opening date and resolution date field.
- v-hjannapuCommunity Support
Hi rakelvillanueva,
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Thank you.
- Greg_DecklerCommunity Champion
rakelvillanueva Have a look at this, I created this specifically for the purpose you are describing:
- rakelvillanuevaRegular 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.
- rakelvillanuevaRegular 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.
- techiesSuper User
Hi rakelvillanueva please try this
Tickets Open on Date =VAR FechaSeleccionada =SELECTEDVALUE('date'[Date])RETURNCALCULATE(COUNTROWS(Merge1),FILTER(ALL(Merge1),Merge1[Apertura] <= FechaSeleccionada &&(ISBLANK(Merge1[TICKETS_CERRADOS.Resolucion]) ||Merge1[TICKETS_CERRADOS.Resolucion] > FechaSeleccionada)))- rakelvillanuevaRegular Visitor
I have tried that solution several times and it has not worked for me.
- wardy912Super User
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 ActiveTicketsI hope this helps!
- rakelvillanuevaRegular Visitor
I have tried that solution several times and it has not worked for me.
- wardy912Super 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?