cancel
Showing results for
Did you mean:  Post Patron

## Grand Total substract with previous record count

Hi Team,

Please share the dax expression for the below requirement. 1 ACCEPTED SOLUTION  Solution Supplier

Thank you for the data.

You can create a measure using the following formula.

It will be best if you create a calculated column by summing up all the columns in every row. to get total roll up amount

`Total =VAR totalvalue =CALCULATE ( SUM ( 'Table'[RollUp] ), REMOVEFILTERS ( 'Table' ) )VAR monthvalue =CALCULATE ( SUM ( 'Table'[RollUp] ) )VAR Total =IF ( ISBLANK ( monthvalue ), BLANK (), totalvalue )VAR CurrentDate =MAX ( 'Table'[Month] )VAR rollupYTD =CALCULATE (SUM ( 'Table'[RollUp] ),FILTER ( ALL ( 'Table' ), 'Table'[Month] < CurrentDate ))VAR result = Total - rollupYTDRETURNresult`

You can get result as follows Thanks,

Sayali

If this post helps, then please consider Accept it as the solution to help others find it more quickly.

4 REPLIES 4  Solution Supplier

Thank you for the data.

You can create a measure using the following formula.

It will be best if you create a calculated column by summing up all the columns in every row. to get total roll up amount

`Total =VAR totalvalue =CALCULATE ( SUM ( 'Table'[RollUp] ), REMOVEFILTERS ( 'Table' ) )VAR monthvalue =CALCULATE ( SUM ( 'Table'[RollUp] ) )VAR Total =IF ( ISBLANK ( monthvalue ), BLANK (), totalvalue )VAR CurrentDate =MAX ( 'Table'[Month] )VAR rollupYTD =CALCULATE (SUM ( 'Table'[RollUp] ),FILTER ( ALL ( 'Table' ), 'Table'[Month] < CurrentDate ))VAR result = Total - rollupYTDRETURNresult`

You can get result as follows Thanks,

Sayali

If this post helps, then please consider Accept it as the solution to help others find it more quickly.  Solution Supplier

Could you provide how the data looks like?  In this example, it is not possible to know how we get the first value.

Regards,

Sayali  Post Patron   Community Support

Does @sayaliredij ’s solution  can work  for you?

It will help other community members easily find the solution when they get the similar issue.

Best Regards,
Community Support Team _ Eason Announcements #### Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories. #### Power BI Dev Camp - September 30th, 2021  