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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors