Forum Discussion
Creating a measure that passes measure from different table
- 8 years ago
To get around that error you have to do an explicit filter
formula = CALCULATE ( COUNT ( Emp[Pernr] ), FILTER(Emp, Emp[Date] = MAX ( Emp[Date] ) - 1 ) )
Hope this helps
David
- 8 years ago
Remove any existing filters on Emp by using ALL
CALCULATE ( COUNT ( Emp[Pernr] ),
Filter(ALL(Emp), Emp[Date] = MIN('Date'[Date])-1
))
I was not able to use the measure. I get the below error
A function 'MAX' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
To get around that error you have to do an explicit filter
formula = CALCULATE ( COUNT ( Emp[Pernr] ), FILTER(Emp, Emp[Date] = MAX ( Emp[Date] ) - 1 ) )
Hope this helps
David
- eiprakash8 years agoFrequent Visitor
This is great ! It worked thanks.
As a followup from the same expression. I am trying to solve the following.
When user selects 2018, I would like to calculate a measure that does the following:
CALCULATE ( COUNT ( Emp[Pernr] ),
Filter(Emp, Emp[Date] = MIN('Date'[Date])-1
))MIN('Date'[Date])-1 = 12/31/2017
Since I mention an explicit filter it filters Emp table to 2018 so this above measure returns a blank.
Greatly appreciate your help.
- dedelman_clng8 years ago
Community Champion
Remove any existing filters on Emp by using ALL
CALCULATE ( COUNT ( Emp[Pernr] ),
Filter(ALL(Emp), Emp[Date] = MIN('Date'[Date])-1
))- eiprakash8 years agoFrequent Visitor
Thanks much ! Perfect worked well!