Forum Discussion
Subtotals incorrect on Table visual
- Anonymous1 year ago
Hi Anonymous ,
We can simplify your metric to make sure it is calculated correctly at different levels of aggregation. You can use the ISINSCOPE function to check if the current context is at the level of detail you want.Min Stock Req 2 = IF( ISINSCOPE('Inventory_Detail_Total'[Device Name]) && ISINSCOPE('Inventory_Detail_Total'[Part Simple]) && ISINSCOPE('Inventory_Detail_Total'[Supplier]), [Min Stock Requirement], SUMX( SUMMARIZE( 'Inventory_Detail_Total', 'Inventory_Detail_Total'[Device Name], 'Inventory_Detail_Total'[Part Simple], 'Inventory_Detail_Total'[Supplier] ), [Min Stock Requirement] ) )
This measure uses ISINSCOPE to check if the current context is at the Device Name, Part Simple, and Supplier level of detail. If it is, it returns the Min Stock Requirement, and if it is not, it aggregates the data at the desired level and then sums the Min Stock Requirement.If the above changes can't be resolved, you amount can provide full example data and MEASUREMENTS so we can help you faster. Please hide sensitive information in advance.
Best regards,
Albert HeIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi Anonymous ,
We can simplify your metric to make sure it is calculated correctly at different levels of aggregation. You can use the ISINSCOPE function to check if the current context is at the level of detail you want.
Min Stock Req 2 =
IF(
ISINSCOPE('Inventory_Detail_Total'[Device Name]) &&
ISINSCOPE('Inventory_Detail_Total'[Part Simple]) &&
ISINSCOPE('Inventory_Detail_Total'[Supplier]),
[Min Stock Requirement],
SUMX(
SUMMARIZE(
'Inventory_Detail_Total',
'Inventory_Detail_Total'[Device Name],
'Inventory_Detail_Total'[Part Simple],
'Inventory_Detail_Total'[Supplier]
),
[Min Stock Requirement]
)
)
This measure uses ISINSCOPE to check if the current context is at the Device Name, Part Simple, and Supplier level of detail. If it is, it returns the Min Stock Requirement, and if it is not, it aggregates the data at the desired level and then sums the Min Stock Requirement.
If the above changes can't be resolved, you amount can provide full example data and MEASUREMENTS so we can help you faster. Please hide sensitive information in advance.
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- Anonymous1 year agoNot applicable
Thank you Anonymous that has worked! I really appreciate your help!
Sadie