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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Wresen
Post Patron
Post Patron

Calculation between 2 tables

Hi , and thanks for reading this.

 

I am still learing this but and i have hit a litte bump on the road.

 

I have 2 tables

 

table1.JPGTable2.JPG

I have a relationship between Month and Month (one to one, both)

 

The Measure 2 is  "Measure 2 = (SELECTEDVALUE(test2[matte])* SELECTEDVALUE(test[value]))"

 

How can i make so if i remove "month"  a Sum of the Measure 2 value

 

If i remove  month :

(i would like it to show the sum of measure 2 =35 in line with 2019 and 11)

month removed.JPG

 

Thanks so much

 

 

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @Wresen 

 

try this

Measure 2 = calculate(sumx(test;calculate(sum(test2[Matte]))*calculate(sum(test[value]))))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

6 REPLIES 6
az38
Community Champion
Community Champion

Hi @Wresen 

 

try this

Measure 2 = calculate(sumx(test;calculate(sum(test2[Matte]))*calculate(sum(test[value]))))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Thanks so much.

That worked perfect.

 

I think i need to readup on SUMX to understand what i going on

 

Thanks again

 

az38
Community Champion
Community Champion

@Wresen 

well, if try to descripe it simple:

sum - is a sum of values from one exactly column (maybe with some filters)

sumX - is a sum of a calculated expressions which could use more than one column


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Sorry for late answer.

Thanks so much for the help

 

I have one more strange question regarding this.

How do i use a IF statment in this example.

 

The table "test2" does not excist and and want to:

If test.month =1 then value *2 ; If test.month =2then value *3;If test.month =3 then value *4

 

I also want the claculation to be correct when i remove month.

I hop i have manages to explain myslef.

 

az38
Community Champion
Community Champion

Hi @Wresen 

create new calculated column in the table 1 with IF statement then multiply as you wish

...if i understand you correct 🙂


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Hi Az38 ;and Thanks for helping

 

It needs to be a mesure since the multiplyed value will change depening on filters (if i managed to make the report)

 

 

Table3.JPG

We have this table , and i want to make a measure that checks the month and depeding on month it will multiply with a number.

If (month = 1 then value *2;If (month = 2 then value *3;If (month = 2 then value *4;

 

and when i remove month  and value i want the still be there

 

table4.JPG

So if it would work i would have Measure to the right of year and a value 35 

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

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.