Forum Discussion
nok
1 year agoAdvocate II
Check scale based on most recent minor date
Hello! I have two tables that follow this structure: ProductsTable ID RequestDate Amount 111 23/06/2025 1000 111 24/06/2025 1010 111 19/07/2025 300 222 11/10/2025 500 ...
- 1 year ago
Hi nok ,
Following dax code for a new calculated column should work :
InScale = VAR _A = SUMMARIZE(FILTER(ScaleTable,ScaleTable[ID]=EARLIER(ProductTable[ID])), ScaleTable[ID],"@MaxDate", CALCULATE(MAX(ScaleTable[StartDate]), ScaleTable[StartDate]< EARLIER(ProductTable[RequestDate]))) VAR _MaxDate = MAXX(_A,[@MaxDate]) VAR _Scale= CALCULATE(MAX(ScaleTable[Scale]), _MaxDate= ScaleTable[StartDate]) RETURN IF(_Scale = ProductTable[Amount] , TRUE() , FALSE())We are creating a virtual table (summarize) of the scale table to only match the selected ID of the row in the product table where the max start date is before the requested date. Then we calculate the Scale of that date and look if the amount matches
V-yubandi-msft
1 year agoCommunity Support
Hi nok ,
Thanks for reaching out to the Fanbroc Community. Ashish_Mathur , Demert has shared a solution that looks spot on with what you’re aiming for. Feel free to go through the suggestions, and if you have any questions or need further tweaks, we’re here and happy to help.
Big thanks to Ashish_Mathur , Demert for the helpful input.
— Yugandhar
Community Support Team.