cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Jacy Regular Visitor
Regular Visitor

Add the accumulated value to the filtered date

Hello,
I need to accumulate a value from the beginning of the year until the date filtered by the user. But the beginning of the year is not always January, it may be April. In this case I have a table that shows how effective each year. Ex:

Sem título.png
In the case when the user filters a period it should see the value of the beginning of the fiscal year until that filtered date.
This value has to be viewed by company, the measure below works for card objects, but not for charts with dimensions other than date. I believe that 'all' is doubling the values ​​for all companies.

 

''Accumulate =
var maxfytd = CALCULATE(MAX(F0902[FYTD]))
var maxdate = CALCULATE(MAX(F0902[.Data]))

return
CALCULATE(SUM(F0902[Valor]);
FILTER(ALL(F0902);F0902[FYTD] = maxfytd && F0902[.Data] <= maxdate))'

 

Can someone help me?

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-danhe-msft
Microsoft

Re: Add the accumulated value to the filtered date

Hi @Jacy,

Based on my test, you can refer to below steps:

1.I have entered some sample data like the picture below:

M.PNG

2.Create a measure.

Measure = CALCULATE(SUM(Sheet5[Value]),FILTER(ALL(Sheet5),'Sheet5'[Date]<=SELECTEDVALUE('Sheet5'[Date]) && YEAR(Sheet5[Date])=YEAR(SELECTEDVALUE(Sheet5[Date]))))

3.Create a Card visual and create a slicer, add the related field. Now you can see the result.

MM.PNG

You can also download the PBIX file to have a view.

https://www.dropbox.com/s/en4a82r1thj3e46/Add%20the%20accumulated%20value%20to%20the%20filtered%20da...

 

Regards,

Daniel He

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

2 REPLIES 2
Microsoft v-danhe-msft
Microsoft

Re: Add the accumulated value to the filtered date

Hi @Jacy,

Based on my test, you can refer to below steps:

1.I have entered some sample data like the picture below:

M.PNG

2.Create a measure.

Measure = CALCULATE(SUM(Sheet5[Value]),FILTER(ALL(Sheet5),'Sheet5'[Date]<=SELECTEDVALUE('Sheet5'[Date]) && YEAR(Sheet5[Date])=YEAR(SELECTEDVALUE(Sheet5[Date]))))

3.Create a Card visual and create a slicer, add the related field. Now you can see the result.

MM.PNG

You can also download the PBIX file to have a view.

https://www.dropbox.com/s/en4a82r1thj3e46/Add%20the%20accumulated%20value%20to%20the%20filtered%20da...

 

Regards,

Daniel He

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

Microsoft v-danhe-msft
Microsoft

Re: Add the accumulated value to the filtered date

Hi @Jacy,

could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?

 

Regards,

Daniel He

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

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors