Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
71 | |
56 | |
39 | |
35 |
User | Count |
---|---|
66 | |
66 | |
59 | |
53 | |
45 |