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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Rai_BI
Helper IV
Helper IV

Correct calculation for grand total

Hi, please, someone help me.

 

I have an issue as below.

How can I adjust the DAX measure below to also calculate the sum for the grand total?

I have the following DAX measure below, it works correctly for each line, but it is not calculating the total value of the grid which is returning empty. I'm trying to use the SUMX function but it's not working to calculate the grand total.

You can download the PBIX file here

 

Single Measure = 

VAR Seller_1_in_Scope = HASONEFILTER('customer table'[Name Seller1])
VAR Seller_2_in_Scope = HASONEFILTER('customer table'[Name Seller2])

RETURN
SWITCH(
    TRUE(),
    Seller_1_in_Scope && NOT Seller_2_in_Scope, 
    SUMX(
        VALUES('customer table'[Name Seller1]),CALCULATE([Goal Seller 1])),

    Seller_2_in_Scope && NOT Seller_1_in_Scope, 
    SUMX(
        VALUES('customer table'[Name Seller2]),CALCULATE([Goal Seller 2])),

    Seller_1_in_Scope && Seller_2_in_Scope, 
    SUMX(
        SUMMARIZE(
            'customer table',
            'customer table'[Name Seller1],'customer table'[Name Seller2]),
            CALCULATE([Goal Seller 1] + [Goal Seller 2])
)
)

 

Sem título.png

2 REPLIES 2
nareshr89
Helper II
Helper II

Try this 

Single Measure = [Goal Seller 1] + [Goal Seller 2]

Thank you, but it is not so easy, i need no check what column is in scope before calcate

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.