Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello everyone!!!!
I'm wanting to accumulate a measure and it's not working for me. Below I present the table. There the column that does not work for me is what I call 'Accumulated Variation', this column what I should do is to accumulate by year what the column 'Monthly Variation' shows (0.00%+5.56%+0.00%+9.21%+ ....)
I have 3 measures created:
VAR IndiceMesAnterior =
CALCULATE([Index],DATEADD(Calendar[Date],-1,MONTH))
RETURN
DIVIDE(([Index]-IndexMesAnterior), IndexMesAnterior)
CALCULATE([Monthly Variation],DATESYTD(Calendar[Date]))
In measure 2 what I do is calculate the monthly variation that there was with the 'Index' field. This measure gives the correct information.
I have the problem in measure 3. To this extent I want to accumulate by year what is shown in measure 2. Obviously the way I am accumulating that I am doing in measure 3 is not correct.
The result of measure 3 ('Cumulative Variation'), should give me this result:
Each of these results is the cumulative sum per year of measure 2 ('Monthly variation').
I share Power Bi file link where this project is so that you can access:
file://CARLOS-MARI-UA/Users/Carlos%20Mar%ED/Google%20Drive/Prueba.pbix
Thank you very much for the help you can give me.
Carlos
Solved! Go to Solution.
Hi @Syndicate_Admin ,
Please try:
Accumulated Variation =
IF (
MIN ( Calendar[Datekey] ) <= CALCULATE ( MAX ( Table[DateKey] ), ALL ( Table ) ),
CALCULATE (
[Total ],
FILTER (
ALL ( Calendar[Datekey] ),
Calendar[Datekey] <= MAX ( ( Calendar[Datekey] ) )
)
),
BLANK ()
)
If it does not work , please provide more details about your table.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello! Issue resolved!!!! Thanks a lot!!!!!!!
Hi @Syndicate_Admin ,
Sorry for my late reply. But I could not get your pbix file.You may refer to this blog to learn How to provide sample data in the Power BI Forum
Best Regards,
Eyelyn Qin
Thank you Evelyn for your willingness to help me.
I pass the link:
Hi @Syndicate_Admin ,
Please try:
Accumulated Variation =
IF (
MIN ( Calendar[Datekey] ) <= CALCULATE ( MAX ( Table[DateKey] ), ALL ( Table ) ),
CALCULATE (
[Total ],
FILTER (
ALL ( Calendar[Datekey] ),
Calendar[Datekey] <= MAX ( ( Calendar[Datekey] ) )
)
),
BLANK ()
)
If it does not work , please provide more details about your table.
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Evelyn, thank you for your reply.
I tried the code you sent and it works well if I use to accumulate the measure I call 'Index' that its DAX code is'Index = sum(Table[Index])'. The problem I have is that what I need to accumulate is another column that is also a measure that I call 'Monthly Variation' (in the first message is the code of this measure). When I use the code you sent me and only change by this measure, there everything is decompressed and gives any value.
Obviously the measure 'Monthly Variation', which is the measure that I need to accumulate, makes the answer not the natural one, as it happens well when using the other measure ('Index') with the code you sent.
I share the URL of the project so you can see to try it directly (I share the URL to place in the browser since it gives me error when I try to do it as a link access):
file://CARLOS-MARI-UA/Users/Carlos%20Mar%ED/Google%20Drive/Prueba.pbix
Thank you very much for your help.
Best regards
Carlos.
Thank you very much for the help shared. I tried the code, in the two alternatives you mention, and it doesn't work.
First create the measure
If there were any other ideas I would be very grateful.
@Syndicate_Admin , Create a measure like
D = CALCULATE(SUM(Table[Index]),Filter(all('Calendar'), 'Calendar'[Date]< = Max(Calendar[Date])))
or
D= CALCULATE(SUM(Table[Index]),Filter(all('Calendar'), 'Calendar'[Date]< = eomnoth(Max(Calendar[Date]),-1) ))
then divide
divide(SUM(Table[Index]),[D])
Thank you very much for the help shared. I tried the code, in the two alternatives you mention, and it doesn't work.
First create the measure
If there were any other ideas I would be very grateful.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
87 | |
81 | |
53 | |
37 | |
35 |