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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
leekarensl
Helper II
Helper II

Cumulative Order Count not having correct row and column totals

Hey all,

 

I wonder if you are able to assist. My stakeholder is after a measure that calculates the cumulative count of order_id by campaign and strategy. However while the actual cumulative order count is working, for some reason the row and column totals are not adding up properly and are just taking the last figure. Is there a way that I can get the measure to calculate cumulative count of order-id and also for the totals to be correct? I can't seem to attach the pbix file here but I am attaching screenshot of the output:

 

The measure is defined as:

cumu_date =
CALCULATE(
    count(data1[ORDER_ID]),
    FILTER(
        ALLSELECTED(data1),
        data1[CONVERSION_DATE] <= max(data1[CONVERSION_DATE])&&
        data1[CAMPAIGN] = max(data1[CAMPAIGN])&&
        data1[STRATEGY] = max(data1[STRATEGY])
    )
)

 

Thanks in advance for your help.Screenshot 2024-09-19 140149.png

 

1 ACCEPTED SOLUTION

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1727134897041.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

13 REPLIES 13
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file and show the expected result very clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks for your response. I have shared as part of this chat.

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1727134897041.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Perfect! Thank you so much!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi, @leekarensl 

 

I've modeled some data that I hope fits your situation. You can try the following.

Count order = COUNT('Table'[ORDER_ID])
Cumulative Count = 
 Var _cumucount=COUNTX(FILTER(ALL('Table'),[CONVERSION_DATE]<=SELECTEDVALUE('Table'[CONVERSION_DATE])),[Count order])
 RETURN
 IF(HASONEVALUE('Table'[ORDER_ID]),[Count order],_cumucount)

vzhangtinmsft_0-1726799329986.png

Is this your desired outcome? Please review the attachment.

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, thanks for your response. No please see attached test pbix and the dataset that I have linked separately as I can't get it to be part of the shared pbix.

 

The table on the left is the normal order count and the row and column totals are calculating correctly. However if you look at the table on the right, take for example 12th March, it is giving cumulative order count for Conversion to be 19 when it should be 33. So below screenshot should be the correct output for example for 12th March:

 

Screenshot 2024-09-23 092821.png

 

test pbix 

dataset 

 

Thanks in advance for your help.

elitesmitpatel
Super User
Super User

Please share the PBIX file with Dummy data and Highlight the expected output.

Thanks for your reponse. I have shared as part of this chat.

Thanks for your response. While I can attach screenshots, there's no option for me to insert the pbix file here.

1st upload the file in onedrive or google drive then click on   below highlighted icon and attach the link of your pbix file

elitesmitpatel_0-1726755372253.png

 

danextian
Super User
Super User

Hi @leekarensl 

 

Why the need the cumulative to sum the cumulative count of each row at the total level? Cumulative count is supposed to be the running balance at a given date. For example if Sep 1- 19 had a unit sale of 1 each, each date would have a cumulative count equivalent to the day of month and  so on Sep 19, the running count would just be 19 and not the sum of all cumulative counts of each date.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Because we want to know what the cumulative totals are by campaign (row totals) and strategy (column totals).

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.