Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have created a crossjoin table to see how many employees are active per year in our company:
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
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
Try this.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
147 | |
107 | |
105 | |
87 | |
61 |