Forum Discussion
Measure to subtract from a calculated column incorrect
Hi Community,
I have following measure yeilding incorrect result: Hrs per month is a column & total leaves hours is a measure.
Hi, Anonymous
The fundamental error in the operation turns out to be the lack of underlying data. This situation does not give you the results you expect.
Maybe you can try this one.
hrs worked = IF ( SELECTEDVALUE ( 'Emp Leave'[Hrs per month] ) <> BLANK (), SELECTEDVALUE ( 'Emp Leave'[Hrs per month] ) - [Total Leaves Hours], BLANK () )Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- parry2k
Super User
Anonymous what is total leave hours measure, is it a simple sum or something else going in there?
- AnonymousNot applicable
parry2k Total leaves Hours measure is calculated based on leave start & leave end date, it also excludes weeekends and public holidays.
Total Leaves Hours =calculate(SUMX (ADDCOLUMNS (SUMMARIZE ( 'Emp Leave', 'Emp Leave'[emp_code], 'Emp Leave'[date_start], 'Emp Leave'[date_end],'Emp Leave'[Hrs per Day] ),"diff",COUNTROWS (FILTER (Datedim,Datedim[Date] >= EARLIER ( 'Emp Leave'[date_start] )&& Datedim[Date] <= EARLIER ( 'Emp Leave'[date_end] )&& datedim[working days]=1))),[diff]*[Hrs per Day]), CROSSFILTER('Emp Leave'[date_start],datedim[Date],None))
- parry2k
Super User
Anonymous At a high level looking at this, I think the measure is the issue why you are not getting results, although I have to check and test it.
- v-zhangti
Community Support
Hi, Anonymous
The fundamental error in the operation turns out to be the lack of underlying data. This situation does not give you the results you expect.
Maybe you can try this one.
hrs worked = IF ( SELECTEDVALUE ( 'Emp Leave'[Hrs per month] ) <> BLANK (), SELECTEDVALUE ( 'Emp Leave'[Hrs per month] ) - [Total Leaves Hours], BLANK () )Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.