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

Sum of column grouped by month

Hi,

    I have a table and a bar chart (see below). For each month in the bar chart I want to apply the following algorithm

 

if
[Status] is "Open"
and
[CreatedDate] before end of the previous month
then
sum [Exposure] till end of previous month

 

The intention is to provide a running total of [Exposure] by Month.

 

I tried creating a calculate expression:

 

Last Day of Previous Month Exposure = CALCULATE(SUM(Risks[Exposure]),Risks[CreatedDate] < [Last Date of Previous Month],Risks[Status]="Open")

 

I am unclear if a measure is the way to solve this. Sorry for newbie question.

 

Chart.png

 

 

 

CreatedDateExposureModifiedDateStatus
19/02/20181019/02/2018Open
19/12/2017906/02/2018Open
25/01/2018925/01/2018Open
19/12/20172027/12/2017Closed
19/12/20171527/12/2017Closed
19/02/20181519/02/2018Open
19/12/20171628/12/2017Closed
09/01/20182012/02/2018Open
19/02/20181019/02/2018Open
19/12/2017906/02/2018Open

 

Many thanks

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Lenin,

 

You may take a look at link below.

http://community.powerbi.com/t5/Desktop/Cummulative-sum-by-month-and-year/m-p/365277#M165160

Community Support Team _ Sam Zha
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-chuncz-msft
Community Support
Community Support

@Lenin,

 

You may take a look at link below.

http://community.powerbi.com/t5/Desktop/Cummulative-sum-by-month-and-year/m-p/365277#M165160

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

v-chuncz-msft thanks a million it worked first time. I ended up with

 

Last Day of Previous Month Exposure =
VAR d =
[Last Date of Previous Month]
RETURN
CALCULATE (
SUM([Exposure]),
FILTER (
ALL ( 'Risks' ),
Risks[CreatedDate] <= d
&& Risks[Status]="Open"
)
)

@Lenin,

 

Glad to hear that. You may help accept solution. Your contribution is highly appreciated.

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

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.