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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
pafernandes
Regular Visitor

Summarize Table by Month and Year.

Hi. I'm trying to create a summary table that group YY-AAAA and category.

Table data

 

Table Date

pafernandes_0-1653310636460.png

 

 

Problem
When I try calculate the number of tickets close in May, the formulate get only five tickets, but the correct it's 10. five it's the quantity of tickets close in May but open in May.

 

 

 

 

 

 

Resumo Ticket's II = 
var dim_calenddario  = 
    SUMMARIZE(            
        dCalendario
        ,dCalendario[AnoMes]
        ,dCalendario[Ano]
        ,dCalendario[Mês]
        ,"First Day" , MIN(dCalendario[Date]))
        
 var dim_cross = CROSSJOIN(dim_calenddario,Tipo_Tickets)

 var dim_dados = SUMMARIZE(
                    dim_cross
                   ,[AnoMes]
                   ,[Tipo]
                   ,[First Day]
                   , 
                    "Chamados criados" ,
                        CALCULATE(
                        COUNT('Controle de Ticket´s BI (2)'[ID Ticket]), 
                        ALL('Controle de Ticket´s BI (2)'[Ticket Mtec: Data de criação]),
                        FILTER('Controle de Ticket´s BI (2)', 'Controle de Ticket´s BI (2)'[Ticket Mtec.Tipo_Ticket__c] = [Tipo]),
                        FILTER('Controle de Ticket´s BI (2)', FORMAT([Ticket Mtec: Data de criação], "MM-YYYY" ) = FORMAT([First Day],"MM-YYYY"))
                    ),
                    "Chamados fechados" ,
                        CALCULATE(
                        COUNT('Controle de Ticket´s BI (2)'[ID Ticket]), 
                        ALL('Controle de Ticket´s BI (2)'[Data da Conclusão]),
                        FILTER('Controle de Ticket´s BI (2)', 'Controle de Ticket´s BI (2)'[Ticket Mtec.Tipo_Ticket__c] = [Tipo]),
                        FILTER('Controle de Ticket´s BI (2)', FORMAT('Controle de Ticket´s BI (2)'[Data da Conclusão], "MM-YYYY" ) = FORMAT([First Day],"MM-YYYY"))
                    )
                )

return dim_dados

 

 

 

 

 

 

Result:

pafernandes_1-1653310681670.png

 

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @pafernandes ,

 

In my sample data, your formula returns the correct result. Could you please share your PBIX file?

 

vkkfmsft_0-1653547191377.png


Best Regards,
Winniz

jennratten
Super User
Super User

I can't read the script but it looks like the calculation is counting the tickets based on the created date instead of the closed date.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors