Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I have a table that I am naming “Transaction_TB” where each row corresponds to a transaction for inputs and outputs of coal tonnage in an inventory system, the table has 4 columns
[Rank] = Unique ID that can be used to sort records in chronological order
[Type] = Type of Transaction (IN or OUT)
[Tons] = amount of ton that are being moved, OUT Type transactions are negative
[Quality]= Only Type IN transaction have quality
I have calculated the BALANCE_TONS after each transaction which is simply add or subtract IN Type transaction minus OUT Type transactions, no problem with that, however my problem is calculating the BALANCE_QUALITY
** BALANCE_QUALITY has to be calculated as weighted average over the Tons
** Only the Type IN transaction affect the quality, so for Type OUT transactions the Quality is the same as previous transaction.
The expected result would be
I appreciate your help and suggestion on how to solve the problem.
Thanks
how you get the balance qty? could you pls provide more details?
Proud to be a Super User!
Hi @ryan_mayu
For Rank # 2 it would be:
For Rank # 3
Quality is the same as previous BALANCE_QUALITY only BALANCE_TONS is affected.
For Rank # 4
Thanks
Proud to be a Super User!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!