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
Anonymous
Not applicable

Calculate sum of 2 measures over a time period for each month

Hello I have a rather simple question to ask but it is not giving me the result I want to have. 

I have 2 measures both being calculated over the same time period (month-year) where Month-year is a column.

The first measure is open tasks and the second measure in closed tasks. 

I want to have another measure/column called backlog such that i want to have the sum of (closed tasks-open tasks) for each month as i need to show it as a line in Line and clustered column chart.

I have been trying to find a way to implement this but SUM and SUMX function both are not working with measures. 

Does anyone have  way to calculate the SUM (closed tasks-open tasks) over Month-year? 

1 ACCEPTED SOLUTION
AlB
Super User
Super User

@charu1313

You mean you want the accumulated difference? Treat

Measure =
CALCULATE (
    [closed tasks] - [open tasks],
    FILTER (
        ALL ( Date[Month-Year] ),
        Date[Month-Year] <= MAX ( Date[Month-Year] )
    )
)

Please mark the resolved question when you are finished and consider giving a thumbs up if the posts are useful.

Contact me privately for assistance with any large-scale BI needs, tutoring, etc.

Bless you

SU18_powerbi_badge

View solution in original post

4 REPLIES 4
AlB
Super User
Super User

@charu1313

You mean you want the accumulated difference? Treat

Measure =
CALCULATE (
    [closed tasks] - [open tasks],
    FILTER (
        ALL ( Date[Month-Year] ),
        Date[Month-Year] <= MAX ( Date[Month-Year] )
    )
)

Please mark the resolved question when you are finished and consider giving a thumbs up if the posts are useful.

Contact me privately for assistance with any large-scale BI needs, tutoring, etc.

Bless you

SU18_powerbi_badge

Anonymous
Not applicable

@AlB Thank you so much.

Works like a charm 🙂

AlB
Super User
Super User

Hi @Anonymous 

I'm not sure I'm following. Can you not just do ?

Measure =

[closed tasks] - [open tasks]

Most likely I'm misunderstanding something

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

 

Anonymous
Not applicable

Hi @AlB ,

This is exactly what i did but it not giving me the exact result I want.

c1.PNG

As you can see from this graph, for October I am getting -2 and for November I am getting -1.

In my scenario I wan to get for November -3, that is, the sum of (closed tasks - open tasks).

Can you please provide me some direction on how to work to get it?

Thank you.

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.