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

Cumulative Total with Reset on Negative amounts

Hi the PB community,

 

I think one picture will summarize better than words.

 

I try to have the display of our UI based on a credits adding / removing. (but sometimes there is some bugs).
Once the cumulative count is at 0 or negative, the formula should display 0, otherwise, the amount of credits.
But once we get credits back, I cant reset the count, it will sum the last values.

I have the overall formula with EARLIER but can't find a way to make him understand to take only credits after the last adding without negative values before.

In EXCEL, formulas is :
=IF(SUMIFS($W$1:W3;$C$1:C3;C4)+V4>0;V4;0)

WaXpEd_1-1618960733667.png

 

 

 

Thanks in advance to any helper 🙂

 

 

5 REPLIES 5
Anonymous
Not applicable

@WaXpEd 

 

I don't think you should do it in DAX, even though I know it's possible since I've done such things is the past. The easiest way to get what you want is to use Power Query where you can easily make use of recursion. Have you tried Power Query?

@Anonymous 

Quite new in DAX and definitely novice on PowerQuery.
I guess i'll go with Excel then even if the calculation duration is massive.

Thanks

Anonymous
Not applicable

@WaXpEd 

 

My friend, you are giving up too early... Power Query is a very easy thing to use. Just a little bit of Googling and YT'ing and you can get 99% things done. Do not give up so easily. Also, there is another forum where people can give you help on issues related to Power Query. I would certainly post your question (re-phrasing a bit) on there.

 

https://community.powerbi.com/t5/Power-Query/bd-p/power-bi-services 

Anonymous
Not applicable

@WaXpEd 

 

It would really be more informative if you showed what you want to do in PBI instead of Excel. From the above I honestly can't make out how your description fits in with the picture (but it may just be me). Can you please give a true picture of what you want to do? You can create a small simplified model in which you'll demonstrate exactly what it is you're trying to achive... It will then be easier for any one of us here to help you. If you want to know how to make a good post that should get you correct answers, please read this: https://community.powerbi.com/t5/DAX-Commands-and-Tips/How-to-Get-Your-Question-Answered-Quickly/td-...

 

Thanks.

Hi @Anonymous,

 

Thanks for taking the time to answer me.

As the picture below :

  • The file contain a lot of UserIDs
  • The balance of credits is already calculated
  • Current Result : what i've done so far, without the reset

Desired Result :
We need to know what credits are added/removed based on the balance.

We have a glitch in our UI that not remove credits if the balance go <0.

Based on this we do not take the values when the balance go under 0.

But once the client buy credits, we need to reset the balance with the amount of credits purchased without considering the negative balance on the previous lines.

 

Don't know how to up the pbix, but here is a picture :

 

WaXpEd_1-1619029220967.png

 

Hope this helps,

If not, will try my best but...

 

Thanks anyway for yout time,

WaX.

 

 

 

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.

Top Solution Authors