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

Acumulated function ignoring slicer

I´m having dificult with a measure , I have a Slicer that filters months , another that filters year, but I want a measure to calculate the sum of the year to that month selected. the problem is that when I choose just a month , for example july, it calculates only the july value. here is the measure:

Date max = MONTH(MAX('Base Act W&D _ SAP'[Date]))

YTDPlan = CALCULATE(SUM('Base Act W&D _ SAP'[Plano 2020.Value]);ALLCROSSFILTERED('Base Act W&D _ SAP');FILTER('Base Act W&D _ SAP';2020>=YEAR('Base Act W&D _ SAP'[Date]));FILTER('Base Act W&D _ SAP';[Data max Filtro]>=MONTH('Base Act W&D _ SAP'[Date])))

Those are not real numbers. just for test.

real plan.PNGslicers only july.PNGslicers.PNG

 

4 REPLIES 4
filipebarros
Frequent Visitor

Hi @filipebarros 

 

Try below measure:

YTDPlan = var a = IF(HASONEVALUE('Base Act W&D _ SAP'[Year]),SELECTEDVALUE('Base Act W&D _ SAP'[Year]),BLANK())
Return 
CALCULATE(SUM('Base Act W&D _ SAP'[Plano 2020.Value]),FILTER(ALL('Base Act W&D _ SAP'),[Data max Filtro]>=MONTH('Base Act W&D _ SAP'[Date])&&YEAR('Base Act W&D _ SAP'[Date])=a))

Pbix attached. 

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

Hi, it still doenst work the value should be 13.718.798 for the july month , but this measure is giving the whole ammount of the year . I just need the accumulated until a month. But thank you for the help.

Greg_Deckler
Super User
Super User

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.