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
guilherme_gq
Helper I
Helper I

Cumulative value Based in other Measure

Hi!

I trying to calculate a Average Headcount (basically is the sum of Monthly HeadCount / number of months). The Monthly HeadCount is the measure that calculates a total value for the month.

 

for example:

 

                                      SET   OUT  NOV  DEZ    JAN
Monthly HeadCount    400   430   450    445    480
Average Headcount     400   415   427    431    441

 

 

  • October is (430 + 400)/2.
  • For November, is (450+430+400)/3.

 

 

does anyone have any idea how to calculate this measure?

 

Thanks!

2 ACCEPTED SOLUTIONS
v-jiascu-msft
Employee
Employee

Hi @guilherme_gq,

 

I would suggest you create a date table if you don't have one. Please check out the demo in the attachment.

Measure =
CALCULATE (
    AVERAGEX (
        SUMMARIZE ( 'Table', 'Calendar'[MonthNum], "v", [Monthly HeadCount] ),
        [v]
    ),
    FILTER (
        ALL ( 'Calendar' ),
        'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
            && 'Calendar'[Date] <= MAX ( 'Table'[Date] )
    )
)

Cumulative_value_Based_in_other_Measure

 

Best Regards,

Dale

Community Support Team _ Dale
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

v-jiascu-msft
Employee
Employee

Hi @guilherme_gq,

 

Could you please mark the proper answer as a solution?

 

Best Regards,
Dale

Community Support Team _ Dale
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

3 REPLIES 3
v-jiascu-msft
Employee
Employee

Hi @guilherme_gq,

 

Could you please mark the proper answer as a solution?

 

Best Regards,
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Employee
Employee

Hi @guilherme_gq,

 

I would suggest you create a date table if you don't have one. Please check out the demo in the attachment.

Measure =
CALCULATE (
    AVERAGEX (
        SUMMARIZE ( 'Table', 'Calendar'[MonthNum], "v", [Monthly HeadCount] ),
        [v]
    ),
    FILTER (
        ALL ( 'Calendar' ),
        'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
            && 'Calendar'[Date] <= MAX ( 'Table'[Date] )
    )
)

Cumulative_value_Based_in_other_Measure

 

Best Regards,

Dale

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

Thanks, man!!!

 

that worked!!!

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.