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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
SLeepyhead
Frequent Visitor

How to Calculate the Sum by filtering two other tables

I try to sum a value from table a exculding values where table  column y does not equall 1 and table c  coulmn c not in {"260","261","262","263"}
 
im using the below measures 
 
CALCULATE(
    SUM(x),
    FILTER(table a ,RELATED(Table b [y]) <> "1"
   &&  Not RELATED(table c [c ]) in {"260","261","262","263"}))
 
what is currently happening its exculding at Table b [y])  that equel 1 regardless of table c [c ] and excluding all table c [c ] that equal {"260","261","262","263"} 
 
it not applying the "and" part of the measures 
2 REPLIES 2
SLeepyhead
Frequent Visitor

example of tables  

 

Table a     
DateA

Region 

Sitetable b keytable  c
1/01/20141a211
2/01/20142b322
3/01/20141a433

 

Table b 
keyb
12
22
31

 

table C 
keyc
1260
2400
3260

 

the result im exspecting is 3 sum (table a ,A)

Anonymous
Not applicable

Hi, @SLeepyhead 

 

Here are my thoughts, maybe you can try the following DAX:

CALCULATE(
    SUM(table a[x]),
    FILTER(
        ALL(table a),
        RELATED(Table b[y]) <> "1"
    ),
    FILTER(
        ALL(table c),
        NOT RELATED(table c[c]) IN {"260", "261", "262", "263"}
    )
)

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data)

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

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

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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