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.
Hi,
You may download my PBI file from here.
Hope this helps.
Hi @Eiji77,
Which formula do you want to calculate the cumulative total with, a calculated column or a measure?
If the former, you could refer to this formula:
Column = CALCULATE(SUM(Table1[Sales]),FILTER('Table1','Table1'[Customer]<=EARLIER(Table1[Customer])))
Result:
If the latter, you could refer to this formula:
Measure = CALCULATE(SUM(Table1[Sales]),FILTER(ALL(Table1),'Table1'[Customer]<=MAX('Table1'[Customer])))
Result:
You could also downlaod the pbix file to have a view.
Regards,
Daniel He
Hi,Daniel. It seems that the way you taught is cumulative order by Customer name. Can you do it in descending order of sales amount?
Hi,
This should be possible to solve without creating an index column. Please share the link from where i can download your PBI file.
Thank you. I want to calculate the cumulative total in the customer group. It is not a customer name.
Hi @Eiji77,
Based on my test, you could add index column to calculate the total running:
Sample data:
Add index coulumn in query editor:
Create calculated column or measure:
Calculated column:
Column = CALCULATE(SUM(Table1[Sales]),FILTER(Table1,'Table1'[Index]<=EARLIER('Table1'[Index])))
Measure:
Measure = CALCULATE(SUM(Table1[Sales]),FILTER(ALL(Table1),'Table1'[Index]<=MAX('Table1'[Index])))
Result:
Regards,
Danilel He
Sorry, I want to calculate the cumulative total in the customer group. It is not a customer name.
Then,I can not index it.
You can add a filter statement that checks for equality within the group. But then to get the correct grand total, you need to add another condition:
Measure = IF ( ISFILTERED ( 'Customer Group'[Customer Group] ), CALCULATE ( SUM ( Sales[Sales amount] ), FILTER ( ALL ( 'Customer Group' ), 'Customer Group'[Customer Name] <= MAX ( Sales[Customer Name] ) && 'Customer Group'[Customer Group] = MAX ( 'Customer Group'[Customer Group] ) ) ), CALCULATE ( SUM ( Sales[Sales amount] ), FILTER ( ALL ( 'Customer Group' ), 'Customer Group'[Customer Name] <= MAX ( Sales[Customer Name] ) ) ) )
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
The result is like this.Why can not I?
My measure creates a cumulative total over your customers within their customer groups:
If this is not what you want, please specify exactly what you need by posting a (picture) of the desired table.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Sorry , I want to this result .
This would be it then:
Measure = CALCULATE ( SUM ( Sales[Sales amount] ), FILTER ( ALL ( 'Customer Group' ), 'Customer Group'[Customer Group] <= MAX ( 'Customer Group'[Customer Group] ) ) )
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
I tried, the result is this.This is different from what I want to do.
Hi,
You may download my PBI file from here.
Hope this helps.
Hi @Eiji77,
If you could not index it, you could use this measure:
Measure = CALCULATE(SUM(Table1[Sales]),FILTER(ALL(Table1),'Table1'[Sales]>=MIN('Table1'[Sales])))
Result:
Regards,
Daniel He
I try Measure in Customer Group , but This resulted in such a result.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |