Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

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 because the table has more than one filter I can't get it to work correctly. I have tried nesting the HASONEFILTER, that doesn't work either. Is there anyone who can help - I can't believe I am the only person in the world that needs this! My table is the one below. I need the subtotal on Min Stock Req 2 column corrected (it should be around 2700), the measure I have done so far is also below. 

 

Sadieh1_0-1732725827432.png

 

Sadieh1_1-1732725947141.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file and show the problem there clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

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

Anonymous
Not applicable

Thank you @Anonymous that has worked! I really appreciate your help!

 

Sadie

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors