CALCULATE strange behaviour

Mer333

Board Regular
Joined
Jun 28, 2014
Messages
54
I have a two linked tables and want to calculate related value from one table by last date from another table but CALCULATE function always do it somehow wrong...

I'm trying to use this formula:

CALCULATE(VALUES('First table'[column2]),FILTER(ALL('First table'),LASTDATE('Second table'[column1])))


It doesn't work at all and when I'm trying to debug it by changing it to calculate countrows it always show the wrong number (37 instead of just 1):


CALCULATE(COUNTROWS(VALUES('First table'[column2])),FILTER(ALL('First table'),LASTDATE('Second table'[column1])))


Any ideas? What am I doing wrong?
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
CALCULATE(COUNTROWS(VALUES('First table'[column2])),FILTER(ALL('First table'),'First table'[column1]=LASTDATE('Second table'[column1]))) provides the same result
 
Upvote 0
Also I found an interesting dependence:


If I have an equal tables and change relationship direction or use LASTDATE from LOOKUP table to find a value in FACT table then formula below works:


CALCULATE(VALUES('First table'[column2]),LASTDATE('Second table'[column1]))


But I need to find a value in LOOKUP table
 
Upvote 0

Forum statistics

Threads
1,224,054
Messages
6,176,107
Members
452,707
Latest member
Cruzito

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top