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

Accumulated column plus percentage of another column

Hi, i need to create a measure, or a calculated column [meta], that returns the value of itself plus 15% of the [value] column.
I managed to create it in excel but i cant figure how i can do this in dax. Here's a print of the excel that i made:

AndreDeLuca_0-1661964965820.png

Resuming, every row i need to accumulate 15% of [value] on my [meta] column. So the [meta] column would start being equal to the [value] column because 15% of 0 is 0, so there's nothing to accumulate.

Sorry for bad gramatics, hope you can understand.
Any help is welcome, 
Thank you.

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @AndreDeLuca ,

 

I suggest you to add an index column in Power Query Editor and then create calculated columns by dax.

RicoZhou_0-1662365901569.png

Calculated column:

 

15% = 
'Table'[value] * 0.15
meta = 
VAR _Start =
    CALCULATE ( SUM ( 'Table'[value] ), FILTER ( 'Table', 'Table'[Index] = 1 ) )
VAR _Accumulated =
    CALCULATE (
        SUM ( 'Table'[15%] ),
        FILTER ( 'Table', 'Table'[Index] < EARLIER ( 'Table'[Index] ) )
    )
RETURN
    _Start + _Accumulated

Result is as below.

RicoZhou_0-1662366060289.png

 

 

Best Regards,
Rico Zhou

 

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

4 REPLIES 4
v-rzhou-msft
Community Support
Community Support

Hi @AndreDeLuca ,

 

I suggest you to add an index column in Power Query Editor and then create calculated columns by dax.

RicoZhou_0-1662365901569.png

Calculated column:

 

15% = 
'Table'[value] * 0.15
meta = 
VAR _Start =
    CALCULATE ( SUM ( 'Table'[value] ), FILTER ( 'Table', 'Table'[Index] = 1 ) )
VAR _Accumulated =
    CALCULATE (
        SUM ( 'Table'[15%] ),
        FILTER ( 'Table', 'Table'[Index] < EARLIER ( 'Table'[Index] ) )
    )
RETURN
    _Start + _Accumulated

Result is as below.

RicoZhou_0-1662366060289.png

 

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you my friend, you have solved my problem.

parry2k
Super User
Super User

@AndreDeLuca you need to use PRODUCTX function, check following two videos on my YT channel:

 

Calculate forecast production using cumulative weekly growth % on most recent actual production - Yo...

 

Calculate projected revenue based on compound growth rate - PowerBI - YouTube

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thank you for replying so fast!!
I kinda understood what you did in the video, you did something different from what i needed but i believe you will understand the solution i need.
In the video https://www.youtube.com/watch?v=9Mj592bSKq0 , is exactly what i need, except that the "projection" (meta as i called) needs to start especifically on october 2021 onward and cant go further than the present date because is a projection based on the last month rushed value.
I will try to explain to you the big picture, maybe it will help. There are 3 columns, [initial balance], [rushed value] and [reversed value]. Every month a value for each of these is produced. The initial balance was 0, and was incremented with the expression [rushed value] - [reversed value]. The new column or measure i need is the accumulate of the [rushed value] always growing 15% each month based on the [rushed value] of the month before, beggining on october 2021. This means that the [meta] value on the october 2021 row should return the same value as [rushed value] because there is no month before, and then start to accumulate 15% after this date, exactly how it shows on the excel table. 
Heres a print of the graph for better visualization, the light blue is [initial balance], darkblue [rushed value] and orange [reversed value].

AndreDeLuca_2-1661973251146.png

 

 

You can observe that when the reversed value is greater than the rushed value, the initial balance decreases, and vice versa.

So looking at the table, the columns are: date ; rushed value(Valor Apurado) ; rushed value *0.15 ; meta.

Ignore the red line. So, what i want to show on the first row of META is the value of [rushed value] itself since there is no previous value for us to calculate 15%. I know is confusing but in a more practical way it means that the result on the green line (2nd row) is the sum of the blue and yellow line. And so on, the brown line should be the result of green line + pink line.

Im sorry for this much information, hope you could understand what i meant, i just really need to get this to work. 
Thanks for helping.

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.