Forum Discussion
Dax Addition incorrect
- Anonymous4 years ago
Hi DonPepe ,
Firstly, create a flag measure to filter the table:
Flag = IF(MAX('CurrentWeek'[Activity Name])="Rust" && MAX('CurrentWeek'[RustBoni]) = "Y" ,1,0)OSPDur = CALCULATE(SUM(CurrentWeek[PLA Duration (seconds)]) /3600,FILTER(ALL(CurrentWeek), [Activity Name]<>"Rust"))Boni = [OSPDur]*0.6/7Output is the same as your Test table returns:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
DonPepe Try this DAX:
= IF(CurrentWeek'[Activity Name]="Rust" && 'CurrentWeek'[Boni] = "Y" ,[OSPDur]+[Boni] ,[OSPDur])
It worked in a calculated column but not in a measure.
How can I put the condition on the line "Rust" and sum on all the ID ?
Thanks,
Don
- Tahreem244 years agoSuper User
DonPepe You can use aggregate functions like MIN ,MAX etc.
= IF(MAX(CurrentWeek'[Activity Name])="Rust" && MAX('CurrentWeek'[Boni]) = "Y" ,[OSPDur]+[Boni] ,[OSPDur])
- DonPepe4 years agoHelper II
Sorry but it didn't work.
I think the issue comme from the granularity.
I have to see on the task level if Rust ="Y" and if so, calculate on the ID level the sum of each task duration.OSPDur = Sum(CurrentWeek'[PLA Duration (seconds)])
and Boni = Sum(CurrentWeek'[PLA Duration (seconds)])*0.6/7
I don't know if you understand. But really thanks to help me.Don