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
DMatus
Frequent Visitor

Cumulative sum of a fixed, monthly value?

This has been troubling me for the entire day and I'd really appreciate some help on the matter.

 

I have the following formula: 

CountCallsYTD = CALCULATE(COUNT(Actions[ID_Action], DATESYTD(Calendar[ID_DateText])))

 

Which works just fine and produces the following chart:

 

 

 

 

http://imgur.com/a/8rbAN

 

Now what I'd like to add to this is a "target" cumulative number of Actions per month, so for example, if on average we need to make 30 calls a month, January would show 30, February would show 60 and so on until December (which would show 360).

 

I had to do something similar with daily targets but that was way easier, I've tried many ways to do this but it seems I just lack the knowledge necessary for such a simple thing, could I get some help on this :(?

 

1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@DMatus

 

In this scenario, since your the granularity in your fact table is day level, it's better to assign the target value on day level as well. I assume you have a full calcendar table. Firstly, you need to add a "YearMonth" column in this table for grouping.

 

YearMonth = YEAR('Table'[Date]) & "" & MONTH('Table'[Date])

 

Then just add a column for Daily Target.

 

Daily Target = 30/ CALCULATE(COUNTA('Table'[Date]),ALLEXCEPT('Table','Table'[YearMonth]))

96.PNG

 

 

Now you should be able to cumulative sum with a fixed 30 on month level.

 

Regards,

 

View solution in original post

2 REPLIES 2
v-sihou-msft
Employee
Employee

@DMatus

 

In this scenario, since your the granularity in your fact table is day level, it's better to assign the target value on day level as well. I assume you have a full calcendar table. Firstly, you need to add a "YearMonth" column in this table for grouping.

 

YearMonth = YEAR('Table'[Date]) & "" & MONTH('Table'[Date])

 

Then just add a column for Daily Target.

 

Daily Target = 30/ CALCULATE(COUNTA('Table'[Date]),ALLEXCEPT('Table','Table'[YearMonth]))

96.PNG

 

 

Now you should be able to cumulative sum with a fixed 30 on month level.

 

Regards,

 

Thank you very much for your answer! 

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.