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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
sakuragihana
Helper IV
Helper IV

Need help to sum value

Hello everyone, I have 2 table below : 

Table 1 : 

sakuragihana_0-1677050481378.png

 

Table 2 : 

sakuragihana_1-1677050481375.png

 

I post a pibx in that link : https://drive.google.com/file/d/1v5l0TgW5xPf0o5IqxBqPHSJ59jM-fP-8/view?usp=share_link 

 

I want to sum value from Table 2 that Campus Code is unspecified into Table 1 (respectively Province Name ) . I don't want to show Unspecified in the table 1

Table 1 like : 

sakuragihana_2-1677050481383.png

 

 

Can everyone help me a dax ?

1 ACCEPTED SOLUTION

Hi, @sakuragihana 

 

You can try the following methods.

Lead Digital2 = 
CALCULATE ( SUM ( 'Lead'[# Of Lead Digital] ),
    FILTER ( ALL ( Campus ), [Campus Name] = "Unspecified" ),
    FILTER ( ALL ( 'Lead' ),
        [Province Name] = SELECTEDVALUE ( Campus[Province Name] )
    )
)+SUM('Lead'[# Of Lead Digital])
Lead Direct2 = 
CALCULATE ( SUM ( 'Lead'[# Of Lead Direct] ),
    FILTER ( ALL ( Campus ), [Campus Name] = "Unspecified" ),
    FILTER ( ALL ( 'Lead' ),
        [Province Name] = SELECTEDVALUE ( Campus[Province Name] )
    )
)+SUM('Lead'[# Of Lead Direct])
Lead Referral2 = SUM('Lead'[# of Lead Referral])
Total Lead = [Lead Digital2]+[Lead Direct2]+[Lead Referral2]

vzhangti_0-1677216409755.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

4 REPLIES 4
v-zhangti
Community Support
Community Support

Hi, @sakuragihana 

 

You can try the following methods.
Measure:

Lead Digital2 =
CALCULATE ( SUM ( 'Data Lead'[# Of Lead Digital] ),
    FILTER ( ALL ( Campus ), [Campus Name] = "Unspecified" ),
    FILTER ( ALL ( 'Data Lead' ),
        [Province Name] = SELECTEDVALUE ( Campus[Province Name] )
    )
)
Lead Direct2 = 
CALCULATE ( SUM ( 'Data Lead'[# Of Lead Direct] ),
    FILTER ( ALL ( Campus ), [Campus Name] = "Unspecified" ),
    FILTER ( ALL ( 'Data Lead' ),
        [Province Name] = SELECTEDVALUE ( Campus[Province Name] )
    )
)
Total Lead = SUM('Data Lead'[# Of Lead Digital])+SUM('Data Lead'[# Of Lead Direct])+SUM('Data Lead'[# of Lead Referral])+[Lead Digital2]+[Lead Direct2]

vzhangti_0-1677207537820.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

Hi @v-zhangti , 

I want to Sum value from table 2 into table 1 and don't show the row Unspecified . Example :

sakuragihana_0-1677209931139.png

 

I'm sorry maybe the link is wrong data, I had repaired the link above with a right data 

 

Hi, @sakuragihana 

 

You can try the following methods.

Lead Digital2 = 
CALCULATE ( SUM ( 'Lead'[# Of Lead Digital] ),
    FILTER ( ALL ( Campus ), [Campus Name] = "Unspecified" ),
    FILTER ( ALL ( 'Lead' ),
        [Province Name] = SELECTEDVALUE ( Campus[Province Name] )
    )
)+SUM('Lead'[# Of Lead Digital])
Lead Direct2 = 
CALCULATE ( SUM ( 'Lead'[# Of Lead Direct] ),
    FILTER ( ALL ( Campus ), [Campus Name] = "Unspecified" ),
    FILTER ( ALL ( 'Lead' ),
        [Province Name] = SELECTEDVALUE ( Campus[Province Name] )
    )
)+SUM('Lead'[# Of Lead Direct])
Lead Referral2 = SUM('Lead'[# of Lead Referral])
Total Lead = [Lead Digital2]+[Lead Direct2]+[Lead Referral2]

vzhangti_0-1677216409755.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

 

Hii @v-zhangti , 

 Thank you so much !

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors