cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VitorXavier Frequent Visitor
Frequent Visitor

Accumulate Measure per month not working

Hello,

 

I am trying to make an accumulate vision using the following expression:

 

= CALCULATE(SUM('Value.amount');

FILTER(ALL('calendar'); 

'calendar'[date] <= MAX('calendar'[date])))

 

But it is not accumulating on the graphic vision:
Capturar.JPG

 

The black line is my target that is called "Meta" and is like this in the table:

Capturar.JPG


Do I have to make something else to get my data accumulated?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Accumulate Measure per month not working

Hi @VitorXavier 

Your measures are working fine. The only issue is that you are using the month name only in the rows of the table visual and then the MAX(Table1[Datas]) if the last day of that month in 2020 (which is the max in the calendar table). Since all your values are in 2019 in both fact tables, you get the whole thing. SO you need to add the year to the filter context. If you place a slicer selecting year 2019 this problem is solved. See it all at work in the attached file. 

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

View solution in original post

9 REPLIES 9
Super User
Super User

Re: Accumulate Measure per month not working

Hi @VitorXavier 

Are you using Month from the calendar table in the x-axis of the visual?

Can you share the pbix? or a simplified version that reproduces the problem? 

VitorXavier Frequent Visitor
Frequent Visitor

Re: Accumulate Measure per month not working

Hi @AlB,

 

Thanks for answer.

 

Yes, I am using Month from calendar table.

 

I want to share with you a simplified version, but I didn't find a way to insert the pbix attachment. How can I share with you?

 

 

 

Super User
Super User

Re: Accumulate Measure per month not working

You have to share the URL to the file hosted elsewhere: Dropbox, Onedrive... or just upload the file to a site like tinyupload.com (no sign-up required).

VitorXavier Frequent Visitor
Frequent Visitor

Re: Accumulate Measure per month not working

I uploaded at TinyUpload.com follow the URL: http://s000.tinyupload.com/?file_id=06151779987823636435 

Highlighted
Super User
Super User

Re: Accumulate Measure per month not working

Hi @VitorXavier 

Your measures are working fine. The only issue is that you are using the month name only in the rows of the table visual and then the MAX(Table1[Datas]) if the last day of that month in 2020 (which is the max in the calendar table). Since all your values are in 2019 in both fact tables, you get the whole thing. SO you need to add the year to the filter context. If you place a slicer selecting year 2019 this problem is solved. See it all at work in the attached file. 

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

View solution in original post

VitorXavier Frequent Visitor
Frequent Visitor

Re: Accumulate Measure per month not working

Thank you very much @AlB , your explanation worked!

VitorXavier Frequent Visitor
Frequent Visitor

Re: Accumulate Measure per month not working

@AlB  If I want to see an accumulated view of two years in the same graphic, 2018 and 2019 for example, for I comparer one year with another, how can I do?

Super User
Super User

Re: Accumulate Measure per month not working

@VitorXavier 

You mean you want to see one line per year in the same chart? With what you have, the quickest would be to place Calendar[Year] in the legend of the chart, so that you have them separated by year and modify the measure a bit so that it only accumulates from the beginning of that year. If you want it to accumulate from the beginning of time, just remove the year condition in FILTER().See it all at work in the attached file. 

 

Meta Acumulada V2 = 
 0 + CALCULATE (
        SUM ( 'Metas UPSELL AGO-DEZ'[Meta] );
        FILTER (
            ALL ( 'Calendário' );
            'Calendário'[Datas] <= MAX ( 'Calendário'[Datas] )
                && YEAR ( 'Calendário'[Datas] ) = YEAR ( MAX ( 'Calendário'[Datas] ) )
        )
    )

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

 

 

VitorXavier Frequent Visitor
Frequent Visitor

Re: Accumulate Measure per month not working

@AlB 

 

The data of the years are separated in different tables and the expression won't work in this case. I tried to put the calendar[year] in the legend but didn't work.

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 451 members 4,382 guests
Please welcome our newest community members: