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
MCDyna
Helper I
Helper I

Cumulative from the calculation of last month

Hi!

 

I made the quick measure to calculate how many orders were made and how many were complete in a month. 

It shows in the line now, but I want the line to show the cumulative of each month.

 

I hope someone can help me with this.

 

MCDyna_0-1635330151747.png

 

1 ACCEPTED SOLUTION

Hi, @MCDyna 

 

You need to create a column first then create a measure.

You can try:

Column = MONTH(Table13[CREATED])

 

measure 3=
CALCULATE (
    COUNT ( Table13[CODE] ) - COUNT ( Table13[COMPLETED] ),
    FILTER ( ALL ( Table13 ), [Column] <= SELECTEDVALUE ( Table13[Column] ) )
)
​

vjaneygmsft_0-1636114290329.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.


Best Regards,
Community Support Team _ Janey

View solution in original post

12 REPLIES 12
v-janeyg-msft
Community Support
Community Support

Hi, @MCDyna 

 

According to your description, I think you can create a measure to display your desired result.

Like this:

Measure =
VAR totalcode =
    SUMX (
        FILTER (
            ALL ( 'Table' ),
            MONTH ( 'Table'[Date] ) <= MONTH ( SELECTEDVALUE ( 'Table'[Date] ) )
//if you only have month column you need to add a index column
// 'Table'[index] <= SELECTEDVALUE ( 'Table'[index] ) 
        ),
        [Total CODE]
    )
VAR totalcompleted =
    SUMX (
        FILTER (
            ALL ( 'Table' ),
            MONTH ( 'Table'[Date] ) <= MONTH ( SELECTEDVALUE ( 'Table'[Date] ) )
        ),
        [Total COMPLETED]
    )
RETURN
    totalcode - totalcompleted

vjaneygmsft_0-1635751045439.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.


Best Regards,
Community Support Team _ Janey

Thank you!

I had to adjust some of the naming, and I do not get any errors, but I don't get a line, so the returns are zero?

 

What can I do so you can help me further?🙏

Could it be the problem that I do not have an extra column with the name of the month, like you have in your version?

 

I use my 'creation date' for the axes months. 

Hi, @MCDyna 

 

Do the months in your visual directly use the months in the date hierarchy or something else?

I also use date column, You can modify it according to your own situation.

vjaneygmsft_0-1635930898068.png

Are these two measures or columns?

vjaneygmsft_1-1635931098439.png

I need more details to judge, I may need to know what your source data is, not the data in Visual. Can you explain?

 

Best Regards,
Community Support Team _ Janey

I try to attach my PowerBi, but it says the file type PBIX is not supported.

Tested a DOCX document, same message.

Is there another way I can share?

Hi @MCDyna 

 

You can take a screenshot like this and show me the format(Hide privacy), let me see if it can be clear.

vjaneygmsft_0-1635932227078.png

It is best to refer to this:

How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

Best Regards,
Community Support Team _ Janey

Hi, @MCDyna 

 

You need to create a column first then create a measure.

You can try:

Column = MONTH(Table13[CREATED])

 

measure 3=
CALCULATE (
    COUNT ( Table13[CODE] ) - COUNT ( Table13[COMPLETED] ),
    FILTER ( ALL ( Table13 ), [Column] <= SELECTEDVALUE ( Table13[Column] ) )
)
​

vjaneygmsft_0-1636114290329.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.


Best Regards,
Community Support Team _ Janey

Hi, @MCDyna 

 

You want to calculate count not sum,so it's easy to do.

Try:

Measure 3 = COUNT(Table13[CODE])-COUNT(Table13[COMPLETED])

vjaneygmsft_0-1636019306536.png

Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

 

Best Regards,
Community Support Team _ Janey

Hi Janey,

 

Code and Complete are subtracted from eachother, but I need it to count the previous month too. So the line should look like your first version.

MCDyna
Helper I
Helper I

I do not think it can be done with the quick measure.

 

January needs to be Code-Completed

February needs to be Code-Completed+result of Januari

March needs to be Code-Completed+result of February

 

I suppose I can fix this by changing my measure Code-Complete. I will try figure it out further 🙂

Greg_Deckler
Community Champion
Community Champion

@MCDyna Seems like you should be able to use the Running Total quick measure if I understand your question.



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
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.