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.
Hello everyone,
in this table START_Date & END_DATE columns have 3 values or more (values and their sum), I want to get cumulative for sum values only.... thank u for ur help
Solved! Go to Solution.
Hi @minasaleh669,
You may try this Measure.
CumulativeTotalExcludingData =
VAR cumulativeTotal =
CALCULATE (
SUM ( 'Table'[ACT_COST] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[END_DATE] ),
'Table'[Index] <= MAX ( 'Table'[Index] ) //sum by the order in the screeshot
//'Table'[WBS_ID] <= MAX ( 'Table'[WBS_ID] ) //sum by WBS_ID ascending
)
)
RETURN
IF (
MAX ( 'Table'[START_DATE] ) >= DATE ( 2019, 5, 1 )
&& MAX ( 'Table'[START_DATE] ) <= DATE ( 2019, 7, 1 ),
cumulativeTotal,
BLANK ()
)
As this Measure calculates cumulative total by the order in the screenshot, you need add an extra index column in Power Query Editor(Transform Date). If you just would like to get cumulative total by the order of WBS_ID ascending, then you can try the annotated code.
The result looks like this.
Also, attached the pbix file.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Hi @minasaleh669,
You may try this Measure.
CumulativeTotalExcludingData =
VAR cumulativeTotal =
CALCULATE (
SUM ( 'Table'[ACT_COST] ),
FILTER (
ALLEXCEPT ( 'Table', 'Table'[END_DATE] ),
'Table'[Index] <= MAX ( 'Table'[Index] ) //sum by the order in the screeshot
//'Table'[WBS_ID] <= MAX ( 'Table'[WBS_ID] ) //sum by WBS_ID ascending
)
)
RETURN
IF (
MAX ( 'Table'[START_DATE] ) >= DATE ( 2019, 5, 1 )
&& MAX ( 'Table'[START_DATE] ) <= DATE ( 2019, 7, 1 ),
cumulativeTotal,
BLANK ()
)
As this Measure calculates cumulative total by the order in the screenshot, you need add an extra index column in Power Query Editor(Transform Date). If you just would like to get cumulative total by the order of WBS_ID ascending, then you can try the annotated code.
The result looks like this.
Also, attached the pbix file.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
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 |
---|---|
47 | |
24 | |
20 | |
15 | |
12 |
User | Count |
---|---|
55 | |
48 | |
43 | |
19 | |
19 |