Forum Discussion

Dam's avatar
Dam
New Member
3 years ago
Solved

Problems with accumulative count

Hello,

 

I've got some problem with this field (accumulative count) :

 

Z_Cumul_Qtés =
CALCULATE (
    COUNT ([DOSSIER]),
    FILTER (ALL('DATA'[CI_MOIS]),DATA[CI_MOIS]<= MAX(DATA[CI_MOIS])
    )
)

 

***

CI_MOIS is a numeric format for a month (not date format)

DOSSIER is a reference (text)

CI_ANNEE is a numeric format for a year (not date format)

***

 

First chart = perfect (with filter CI_ANNEE=2022)

Second chart = perfect (with filter CI_ANNEE=2021)

Third chart = with filter CI_ANNEE 2022 & 2021,  and legend CI_ANNEE = how is it possible ? 

 

 

 

  • Dam , if CI_MOIS is in YYYYMM format

    Z_Cumul_Qtés =
    CALCULATE (
        COUNT ([DOSSIER]),
        FILTER (ALL('DATA'[CI_MOIS]),DATA[CI_MOIS]<= MAX(DATA[CI_MOIS])
        )
    )
     
    or
     
     
    Z_Cumul_Qtés =
    CALCULATE (
        COUNT ([DOSSIER]),
        FILTER (ALL('DATA'[CI_MOIS]),DATA[CI_MOIS]<= MAX(DATA[CI_MOIS]) && DATA[Year]= MAX(DATA[Year])
        )
    )
     
    If this does not help
    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

2 Replies

  • Dam , if CI_MOIS is in YYYYMM format

    Z_Cumul_Qtés =
    CALCULATE (
        COUNT ([DOSSIER]),
        FILTER (ALL('DATA'[CI_MOIS]),DATA[CI_MOIS]<= MAX(DATA[CI_MOIS])
        )
    )
     
    or
     
     
    Z_Cumul_Qtés =
    CALCULATE (
        COUNT ([DOSSIER]),
        FILTER (ALL('DATA'[CI_MOIS]),DATA[CI_MOIS]<= MAX(DATA[CI_MOIS]) && DATA[Year]= MAX(DATA[Year])
        )
    )
     
    If this does not help
    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
  • Dam's avatar
    Dam
    New Member

    Thanks Amitchandak,

    It was the best solution...