Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Subtotals incorrect on Table visual

I have created a measure for my table visual (Min Stock Requirement) but the subtotals didn't work. I have tried creating a second measure using HASONEFILTER incorporating the original measure, but b...
  • Anonymous's avatar
    Anonymous
    1 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 He


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly