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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
kyrpav
Helper V
Helper V

calculate sum with criteria from many columns of another filtered table

Hello i want to sum a column but i need to filter the table based on data from another table.

So i have table1 where i want to sum points and i want to sum only the record that for the dates and the names and the classes i find in table 2

 

namesdatesclasspoints
george2020-01-01math10
george2020-02-01physic13
george2020-05-01physic16
george2020-06-01chem19
george2020-07-01math22
mairi2020-01-01math25
mairi2020-02-01physic28
mairi2020-05-01physic31
mairi2020-06-01chem34
mairi2020-07-01math37
nick2020-01-01math40
nick2020-02-01physic43
nick2020-05-01physic46
nick2020-06-01chem49
nick2020-07-01math52
helen2020-01-01math55
helen2020-02-01physic58
helen2020-05-01physic61
helen2020-06-01chem64
helen2020-07-01math67
sundy2020-01-01math70
sundy2020-02-01physic73
sundy2020-05-01physic76
sundy2020-06-01chem79
sundy2020-07-01math82

 

And table2 

namedateclasses
george2020-01-01math
mairi2020-02-01physic
nick2020-05-01physic
helen2020-06-01chem
sundy2020-07-01math

 

I am using measure like this:

 

Measure 3 = CALCULATE(sum(Table1[points]);Table1[name] in (ALLSELECTED(Table2[name]));Table1[date] in (ALLSELECTED(Table2[date]));Table1[class] in (ALLSELECTED(Table2[class]))) but it does not filter properly, 
 
is there any better way to do this?
3 REPLIES 3
nhoward
Resolver I
Resolver I

@kyrpav 

 

That depends on how and where you want to display that result.  A simple way is have a relationship between the 2 tables based on Name.  You can then just use a Sum measure, and let the relationships and table do the filtering. 

then in a table visual put:

 

image.pngimage.png

My problem is that connection is many to many and even when i try to join all 3 columns i get the same classic problem where it does not find solution and places everywhere the same number.

Anonymous
Not applicable

instead of allselelcted try ALLEXCEPT. As it will keep filters on those columns which you mentioned in ALLEXCEPT.

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.