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.
@Phil_Seamark@Zubair_Muhammad @Anonymous @Vvelarde @MFelix
Hello fellow datanuts, Attached is a sheet to calculate the value of balance and explained in "value calculation formula" how the value will be calculated. Balance value column is expected to be the result for each balance column, main columns are
Date
Item
In
Rate
Balance
Basically calculating balance value from previous incoming entries.
How you guys will do it? Would like to pick your brain for the solution.
Thanks,
P
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.
Solved! Go to Solution.
File attached as well.
There are few differences
I think this will work...But there could be an easier way
Column = VAR mybalance = Table1[Balance] VAR temp = FILTER ( Table1, Table1[Item] = EARLIER ( Table1[Item] ) && Table1[Date] <= EARLIER ( Table1[Date] ) && Table1[In] <> BLANK () ) VAR temp1 = ADDCOLUMNS ( temp, "Rank", RANKX ( temp, [Date],, DESC, DENSE ) ) VAR temp2 = ADDCOLUMNS ( temp1, "Cumulative", SUMX ( FILTER ( temp1, [Rank] <= EARLIER ( [Rank] ) ), [In] ) ) VAR temp3 = FILTER ( temp2, [Cumulative] <= EARLIER ( Table1[Balance] ) ) VAR Fullrows = MAXX ( temp3, [Cumulative] ) VAR temp4 = TOPN ( 1, FILTER ( temp2, [Cumulative] > EARLIER ( Table1[Balance] ) ), [Date], DESC ) RETURN IF ( Table1[Balance] <> BLANK (), SUMX ( temp3, [In] * [Rate] ) ) + SUMX ( temp4, ( mybalance - Fullrows ) * [Rate] )
File attached as well.
There are few differences
@Zubair_MuhammadThanks will take a look and also wondering to see if anyone else reply on this and how they will solve it.
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.
@Zubair_Muhammadi would like to accept your solution but still waiting on other experts on how they will approach it?
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.
I still trying to understand the logic involved in this.
Don't get it yet
Regards
Victor
@Vvelardethanks for looking into it, basically it take the balance and go backward until balance quantity is zero, in other words, allocate balance quantity backward to the "in" Quantity and multiply allocated quantity with the rate.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
81 | |
70 | |
62 |
User | Count |
---|---|
148 | |
116 | |
104 | |
90 | |
65 |