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
Dam
New Member

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 ? 

 

Capture_pbi.PNG

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@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.
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Dam
New Member

Thanks Amitchandak,

It was the best solution...

amitchandak
Super User
Super User

@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.
Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.