Forum Discussion
Yonko
Helper I
3 years agoHow to get total value?
Hi there. This is my problem - there is a table with project names, tasks and time (for simplicity there is only 1 project). Each project may have different tasks, and each tasks will take different ...
- 3 years ago
Hi Yonko ,
Based on your description, I have creeated a simple sample:
Please try:
Time = VAR _a = SUM ( 'Table (2)'[Time] ) VAR _b = SELECTCOLUMNS ( FILTER ( ALL ( 'Table' ), [Project] = MAX ( 'Table'[Project] ) ), "Task", [Task] ) VAR _c = SUMX ( FILTER ( ALL ( 'Table (2)' ), [Task] IN _b ), [Time] ) RETURN IF ( MAX ( 'Table'[Task] ) = "Total", _c, _a )Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jianboli-msft
Community Support
3 years agoHi Yonko ,
Based on your description, I have creeated a simple sample:
Please try:
Time =
VAR _a =
SUM ( 'Table (2)'[Time] )
VAR _b =
SELECTCOLUMNS (
FILTER ( ALL ( 'Table' ), [Project] = MAX ( 'Table'[Project] ) ),
"Task", [Task]
)
VAR _c =
SUMX ( FILTER ( ALL ( 'Table (2)' ), [Task] IN _b ), [Time] )
RETURN
IF ( MAX ( 'Table'[Task] ) = "Total", _c, _a )
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.