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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
robsmith1980
Frequent Visitor

SUM of value by customer and month

Hi

 

I hope someone can help!

 

I am trying to create a calculated column or measure that will track the cumulative total of customers subscription values by month

 

IE Total of Customer As $ IN January, Total of Customers Bs $ In January, Total of Cusotomer As $ in February, etc

 

AND

 

Total for January, Total for February, etc

 

Any help greatly appreciated 🙂

 

i currently have the data in a table similar to the below.

 

CustomerSubsctiption IDConsumption DateValue in $
Customer A101/01/201945
Customer A201/01/201920
Customer A301/01/201915
Customer A401/01/201975
Customer B501/01/201978
Customer B601/01/201915
Customer B701/01/201915
Customer C801/01/2019463
Customer C901/01/201945
Customer A101/02/2019499
Customer A201/02/201942
Customer A301/02/201912
Customer A401/02/20192
Customer B501/02/201985
Customer B601/02/20190
Customer B701/02/201983
Customer C801/02/2019846
Customer C901/02/201996
4 REPLIES 4
harshnathani
Community Champion
Community Champion

Hi @robsmith1980 ,

 

123.JPG

 

Incase this is what you are looking for, you will need to create a Calendar Table using CalendarAuto() and link it with you consumption date.

 

Drag Month and Year from the Calendar and Customer and Value in $ from the Subscriber Table.

 

Regards,

Harsh Nathani

 

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

In case it did not help, please provide additional information and mark me with @ so that I can investigate further

Hi @robsmith1980 ,

 

Did the solution work for you.

 

Please mark as solution for other community members to benefit.

 

Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

ash123
Regular Visitor

Hi Rob,

 

I tried to solve your query not sure if that exactly matches your requirement. 

 

I added a calculated Column Commsales. See the table below

 

Capture.JPG

 

Dax to achieve this: 

 

Commsales =
VAR Sales =
SUM ( 'Table'[Value in $] )
VAR customer = 'Table'[Customer]
VAR C_date = 'Table'[Consumption Date]
VAR Subscription = 'Table'[Subsctiption ID]
RETURN
CALCULATE (
SUM ( 'Table'[Value in $] ),
FILTER (
'Table',
'Table'[Customer] = customer
&& 'Table'[Consumption Date] = C_date
&& 'Table'[Subsctiption ID] <= Subscription))
 
Visuals:
 
Capture.JPG
 
Regards,
Kaushlendra Mishra 
Greg_Deckler
Super User
Super User

What is the expected output from your sample data?

 

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



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.