Forum Discussion
joaquinel
3 years agoHelper I
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
| id | idpersona | fecha |
| 1 | 34 | 01/04/2023 |
| 2 | 3 | 01/04/2023 |
| 3 | 5 | 01/04/2023 |
| 4 | 34 | 01/05/2023 |
| 5 | 3 | 01/05/2023 |
| 6 | 5 | 01/05/2023 |
| 7 | 4 | 01/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
1 Reply
- AhmedxSuper User
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
https://1drv.ms/u/s!AiUZ0Ws7G26Rh3KHAmhL66JHK2PA?e=UfZi30