Forum Discussion

joaquinel's avatar
joaquinel
Helper I
3 years ago

Count IDs when exist in a previous month

I need to count the registers (idpersona) of a month if that id exist in the previous month as in example bellow

 

ididpersonafecha
13401/04/2023
2301/04/2023
3501/04/2023
43401/05/2023
5301/05/2023
6501/05/2023
7401/05/2023

 

so, the result must be 3.

 

My (wrong) formula is

 

CALCULATE
                        (
                            COUNT(
                                Pagos[IdPersona]
                                 )
                                 ,
                                 Filter
                                    (Pagos,
                                    Pagos[IdPersona] && PREVIOUSMONTH('1CalFCobro'[Date])
                                    )
                          )

 

Could you, please, help me. Thanks