Forum Discussion
PBI_User1
8 years agoNew Member
Measure doesn't work as expected
Hi, I'm trying to create a Measure to do an incremental sum.
Cost running total in Date =
CALCULATE(
SUM('JobDocs'[Cost]);
FILTER(
ALLSELECTED('JobDocs'[Date]);
ISONORAFTER('JobDocs'[Date]; MAX('JobDocs'[Date]); DESC)
)
)
Somebody can help me?
Thanks
Hi PBI_User1,
Try this formula please.
Cost running total in Date = CALCULATE ( SUM ( 'JobDocs'[Cost] ); FILTER ( ALL ( 'JobDocs' ); 'JobDocs'[Date] <= MAX ( 'JobDocs'[Date] ) ) )Best Regards,
Dale
3 Replies
- v-jiascu-msftMicrosoft Employee
Hi PBI_User1,
Try this formula please.
Cost running total in Date = CALCULATE ( SUM ( 'JobDocs'[Cost] ); FILTER ( ALL ( 'JobDocs' ); 'JobDocs'[Date] <= MAX ( 'JobDocs'[Date] ) ) )Best Regards,
Dale
- v-jiascu-msftMicrosoft Employee
Hi PBI_User1,
Could you please mark the answer as a solution or share your solution?
Best Regards,
Dale
- Ashish_MathurSuper User
Hi,
Try this measure
=CALCULATE(SUM('JobDocs'[Cost]),DATESYTD(Calendar[Date],"31/12/"))
Here are the assumptions:
- You have a calendar Table with Month and Year columns
- There is a relationship from the Data column of the JobsDocs Table to the Date column of the Calendar Table
- In your visual, you will drag Year and Month from the Calendar Table.
Hope this helps.