Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi Team,
I need your help, regarding below column formulas,
1) Remaing UID Stock - > When the UID's are same then Prod_Total should be summed up and at the same time, the difference between the "Prod_Total" and "stock" of each "category" should be found.
And this should work based on dynamic slicer. eg: if slicer is Oct month then Prod_Total should be calculated from Jan to Oct .
Note: Prod_Total is Measures (calculates new measure)

Thanks,
KV's
Sorry, you have covered up UID - which rows are they the same for? How many tables is your raw data? This could be done with the right table visual or ifyou create a measure:
UID Prod Total = CALCULATE(SUM{Table[Prod_Total]), ALL{Table[Category]))
Then subtract that from stock in another or same measure. I'm just not sure how many tables you have and how they are related, so that may change things slightly.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@Anonymous
You should be able to do as a new measure:
Remaining UID Stock = MAX(Table[Stock]) - CALCULATE(SUM(Table[Prod_Total]), ALL(Table[Category]))
or as a new COLUMN:
Remaining UID Stock = Table[Stock] - SUMX(FILTER(ALL(Table), Table[UID] = EARLIER(Table[UID])), Table[Prod_Total])
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@Anonymous , try like
remaining UID Stock = sum(Table[stock])- calculate(sum(Table[Prod_Total]) , allexcept(Table, Table[UID]))
or
remaining UID Stock = calculate(sum(Table[Prod_Total]) , allexcept(Table, Table[UID])) -sum(Table[stock])
Hi @amitchandak , how it will work with dynamic slicer (Date table, UID table separate).
@Anonymous , not very clear. to me it seem like
remaining UID Stock = sum(Table[Prod_Total]) -sum(Table[stock])
remaining UID Stock PO = if([remaining UID Stock]<0, 0, [remaining UID Stock])
Hi @amitchandak ,
expected based on UID (same ID) prod_total subtract by each Category row wise..
Thanks,
KV's
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.