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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Cumulative sum and calendar relation

Hello,

 

I have a problem on my report. I created a measure to have a cumulative column and it works.

But i want to see the weaks where i don't have data, in my exemple i have 3 closed actions :
1 action on weak 7; 1 on weak 10 and 1 on weak 11. The sum works just fine because i see 3 actions on weak 11

But in my graph i would like to have the sum even for the weaks without new actions, so in weak 8 and 9 i want to see 1 closed action. 

 

Here's what my data test look like :

DateOrigine Rédacteur du point DomaineIDAResponsable si action RéférentContributeur DétailsDate Réalisation souhaitéeStatutBloquant pour le blueprintPrésent dans le BluePrintDate de clotureIntégré BP Consultant O/NPrésence BluePHistorique/Résultatà balayer prochain suiviPoint majeur (1/0)Nombre de report d'actionOuvert ou ferméEspérance de vieRetard & ouvertDate YYYYWWDate WW
12023-02-16RéférentielsOTA06 - RéférentielActionGOOTA  2024-05-31Fermé  2024-07-08     0047002023077
22023-03-10ProcessusBPO01 - TransverseActionGOBPO  2024-06-30Fermé  2024-07-08     00478020231010
32024-03-16Conduite de changementBPO01 - TransverseActionGOADE  2024-06-30Fermé  2024-07-08     00106020241111
42024-05-13**bleep** - étudier entre Blueplanner et InforBPO04 - Accords CommerciauxActionGOLGUKCA 2024-09-30A faire        01140020242020
52024-05-13PIM - statuer sur INFOR PLM ou maintien d'agenaLGU06 - RéférentielActionGOLGUCOPIL/MBE/GLA 2024-09-30A faire        01140020242020
62024-05-13Réceptions - statuer sur positionnement VIF ou InforBPO03 - Achats/ Appros/ LogistiqueActionGOLGUBPO 2024-09-30En cours        01140020242020

 

And this is what my measure look like on PBI : 

 

Cumul Actions par Semaine =
CALCULATE(
    [Nombre d'Actions],
    FILTER(
        ALL('Feuil1'[Date WW]),
        'Feuil1'[Date WW] <= MAX('Feuil1'[Date WW])
    )
)
 
 
And the graph look like this after :

Bapt16_0-1724061815061.png

 

I want to have something like that : 

 

Bapt16_0-1724072727113.png

 

 

I hope that's clear, i give you a link of the 2 file here

PBI : test.pbix

Excel : données.xlsx

 

And my other question is that I created 2 measures :

Créées par mois =
CALCULATE(
    COUNT('Feuil1'[Date]),
    USERELATIONSHIP('Calendrier'[Date], 'Feuil1'[Date])
)

 

And

 

Terminées dans le mois =
CALCULATE(
    COUNT('Feuil1'[Date de cloture]),
    USERELATIONSHIP('Calendrier'[Date], 'Feuil1'[Date de cloture])
)

 

Based on the relationship with my calendar table, it is a good way to do it ? Do i really need a calendar table or can i do it with something else ?

1 ACCEPTED SOLUTION

@Anonymous You can fix this with a disconnected table and a measure:

Table = GENERATESERIES( MIN( 'Feuil1'[Date WW] ), MAX( 'Feuil1'[Date WW] ), 1 )



Measure = 
    VAR __MaxDate = MAX( 'Table'[Value] )
    VAR __Table = FILTER( ALL( 'Feuil1' ), [Date WW] <= __MaxDate )
    VAR __Result = COUNTROWS( __Table )
RETURN
    __Result

PBIX is attached below signature.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
95uey
Regular Visitor

I have a similar problem.... 

Greg_Deckler
Community Champion
Community Champion

@Anonymous One small correction to this, the measure should be this:

Measure = 
    VAR __Category = MAX( 'Feuil1'[Statut] )
    VAR __MaxDate = MAX( 'Table'[Value] )
    VAR __Table = FILTER( ALL( 'Feuil1' ), [Date WW] <= __MaxDate && [Statut] = __Category )
    VAR __Result = COUNTROWS( __Table )
RETURN
    __Result


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hello Greg, yes it works with your exemple thank you.
I tried to use the same logic with a real calendar table linked to my fact table "Feuil1". But it doesn't work, i still have some weaks empty in the graph. I was thinking about using total ytd, but i'm probably not using it right because it doesn't work neither

Anonymous
Not applicable

Hello Greg,

I change my first post so it's easier to understand

@Anonymous You can fix this with a disconnected table and a measure:

Table = GENERATESERIES( MIN( 'Feuil1'[Date WW] ), MAX( 'Feuil1'[Date WW] ), 1 )



Measure = 
    VAR __MaxDate = MAX( 'Table'[Value] )
    VAR __Table = FILTER( ALL( 'Feuil1' ), [Date WW] <= __MaxDate )
    VAR __Result = COUNTROWS( __Table )
RETURN
    __Result

PBIX is attached below signature.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Community Champion
Community Champion

@Anonymous Would need to know more about your setup. If you can post sample data as text or a link to your PBIX file (OneDrive, Box, etc.) would help greatly. 

Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.