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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.