Forum Discussion
Cross Tables
hi imy
Just try this formula:
Crosstable Emp/year2 =
FILTER (
CROSSJOIN ( 'All Employee Details', 'Date' ),
'Date'[Date] >= 'All Employee Details'[Contract Start Date]
-- && 'Date'[Date] <= 'All Employee Details'[Contract End Date]
&& 'Date'[Date] <= IF(ISBLANK('All Employee Details'[Contract End Date]),TODAY(),'All Employee Details'[Contract End Date])
)
or
Crosstable Emp/year2 =
FILTER (
CROSSJOIN ( 'All Employee Details', 'Date' ),
'Date'[Date] >= 'All Employee Details'[Contract Start Date]
-- && 'Date'[Date] <= 'All Employee Details'[Contract End Date]
&&'Date'[Date] <= IF(ISBLANK('All Employee Details'[Contract End Date]),MAX('Date'[Date]),'All Employee Details'[Contract End Date])
)
Regards,
Lin
Dear Lin,
I used this formula as I think is a great idea to put all permanent staff with end date today (this way they are taken into consideration in my bar chart);
Crosstable Emp/year2 =
FILTER (
CROSSJOIN ( 'All Employee Details', 'Date' ),
'Date'[Date] >= 'All Employee Details'[Contract Start Date]
-- && 'Date'[Date] <= 'All Employee Details'[Contract End Date]
&& 'Date'[Date] <= IF(ISBLANK('All Employee Details'[Contract End Date]),TODAY(),'All Employee Details'[Contract End Date])
)Crosstable Emp/year2 = FILTER ( CROSSJOIN ( 'All Employee Details', 'Date' ), 'Date'[Date] >= 'All Employee Details'[Contract Start Date] -- && 'Date'[Date] <= 'All Employee Details'[Contract End Date] && 'Date'[Date] <= IF(ISBLANK('All Employee Details'[Contract End Date]),TODAY(),'All Employee Details'[Contract End Date]) )
However, The Contract End Date is still empty, why is this happening?
Many thanks
Imy
- v-lili6-msft6 years agoCommunity Support
hi imy
It should work well, try to remove these code in the formula
-- && 'Date'[Date] <= 'All Employee Details'[Contract End Date]Crosstable Emp/year2 = FILTER ( CROSSJOIN ( 'All Employee Details', 'Date' ), 'Date'[Date] >= 'All Employee Details'[Contract Start Date] && 'Date'[Date] <= IF ( ISBLANK ( 'All Employee Details'[Contract End Date] ), TODAY (), 'All Employee Details'[Contract End Date] ) )For example:
Result:
Do you mean that you want the Contract End Date column for ID 2 is not blank?
Regards,
Lin