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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KH11NDR
Helper IV
Helper IV

How do i create a calculated column or measure for totalling up another column as cumulative?

Hi Guys,

 

This is what I want to do, create another column or measure that calculates Total sales per month per project.  My data is exactly how it is in the table without the "Total Sales" column i'm asking help for.

 

Thanks

 

ProjectDateSalesTotal Sales
A01/01/20181010
A01/02/20182030
A01/03/20183060
A01/04/201840100
A01/05/201850150
B01/01/201855
B01/02/20181015
B01/03/20181530
B01/04/20182050
B01/05/20183080
1 ACCEPTED SOLUTION

@KH11NDR

Please check attached PBIX file.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

12 REPLIES 12
KH11NDR
Helper IV
Helper IV

What's the Dax for this as a measure or column as I can't get the Quick measure calculation to do what I want.

@KH11NDR,

Create a measure using DAX below.

total sales = CALCULATE(SUM(Table[Sales]),FILTER(ALL(Table[Date]),Table[Date]<=MAX(Table[Date])))

1.PNG

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sorry, That hasn't worked for me.

@KH11NDR,

What error message or what result do you get? Do you create a measure? Make sure you create a measure rather than a calculated column.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Yes it's a measure, I don't get any error messages, just a blank row, column.

@KH11NDR

Do you create table visual as mine? Could you please share PBIX file to me? You can share PBIX file through OneDrive.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Do you think it has anything to do with me Unpivoting my columns?

 

Original Data

 

Project ID01/07/201701/08/201701/09/201701/10/201701/11/201701/12/201701/01/201801/02/2018
AAAA05101520253035
BBBB07121824303642

 

Power BI Table

 

ProjectIDDatesValue
AAAA01/07/20170
AAAA01/08/20175
AAAA01/09/201710
AAAA01/10/201715
AAAA01/11/201720
BBBB01/07/20170
BBBB01/08/20177
BBBB01/09/201712
BBBB01/10/201718
BBBB01/11/201724

 

And then in Power BI Matrix table, another row showing the cumualtive totals.

 

Capture.PNG

@KH11NDR

Please check attached PBIX file.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you, I'll use that as my suggestion, I know where I was going wrong now, I was using my Master Calendar Months for the column and not the date field from my table.

 

Thanks again, I'm pretty sure I'll be needing more help, Im an X QlikView 

shebr
Resolver III
Resolver III

HI @KH11NDR

 

Have you tried using the quick measures to try and get your result? Right click on your dataset and select 'Quick Measure'. Select your value and any other options and this may give you what you want.

 

Let us know how you get on.

 

Thanks

 

shebr

How would you do it? As it's not working for me.

I was just trying that, 

 

I selected Running total calculation, Base value as Sales and Field as Project, I was hoping that would have worked, but It's giving the same figures in the month rather than do a runninig total as expected.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.