Forum Discussion
ALL function with text
- 1 year ago
FBergamaschi This is solution provided by copilot. It seams to work.
I dont know if there is need to siplify it but here it is.VAR SummaryTable =CALCULATETABLE(SUMMARIZE(FILTER('Stock adjustment data','Stock adjustment data'[Physical Inventory Status] = "POST"),'Product information'[Product],"TotalDiff", SUM('Stock adjustment data'[Difference Quantity(PIC)])),REMOVEFILTERS('Calendar'[Date]), // ⬅️ This removes the impact of the date slicerALL('Stock adjustment data'))VAR CurrentProduct =SELECTEDVALUE('Product information'[Product])VAR ProductTotal =CALCULATE(MAXX(FILTER(SummaryTable, [Product] = CurrentProduct),[TotalDiff]))RETURNIF(ISINSCOPE('Product information'[Product]),IF(ProductTotal < 0,CALCULATE(MINX(FILTER(SummaryTable, [Product] = CurrentProduct),[TotalDiff])),ProductTotal),SUMX(SummaryTable, [TotalDiff]) // ⬅️ Subtotal logic)
Hi Justas4478
Please try this:
ALCULATE(
SUM('Stock adjustment data'[Difference Quantity(PIC)]),
ALL('Calendar'[Date]),
ALL('Stock adjustment data'[Physical Inventory Procedure]),
ALL('Stock adjustment data'[Reason])
)
I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!