Forum Discussion
Dynamic Project Cost
- 4 years ago
Hi Anonymous
Please change the relationship between fact table and employee table and set the cross filter direction is both.
Result:
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
You can try this code:
Cost =
VAR _start =
IF(
MIN( 'Calendar'[Date] ) >= SELECTEDVALUE( 'Table'[Start Date] ),
MIN( 'Calendar'[Date] ),
SELECTEDVALUE( 'Table'[Start Date] )
)
VAR _end =
IF(
MAX( 'Calendar'[Date] ) <= SELECTEDVALUE( 'Table'[End Date] ),
MAX( 'Calendar'[Date] ),
SELECTEDVALUE( 'Table'[End Date] )
)
VAR _diff =
IF( _start < _end, DATEDIFF( _start, _end, MONTH ) + 1, 0 )
RETURN
_diff * SELECTEDVALUE( 'Table'[Monthly Cost] )
Result:
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi v-chenyue-msft ,
Thanks for the measure.
Although this is what I wanted, the measure doesn't work fine with the columns from other tables.
I have connected the Project table to an Employee table based on Project ID to get the employee details.
I would like to see the Project name, respective Employee email and the cost.
Sample below.
Could you kindly suggest on how can the measure work when a column from other tables are got in the table.
Thanks,
Regards.
- v-chenwuz-msft4 years agoCommunity Support
Hi Anonymous
Please change the relationship between fact table and employee table and set the cross filter direction is both.
Result:
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.