Forum Discussion
Dax running total after certain Month
- 6 years ago
Hi Anonymous ,
Try to create a measure like so:
Measure = IF ( MAX ( 'Calendar'[MonthNo.] ) > 3, CALCULATE ( SUM ( Sales[Sales] ), FILTER ( ALLSELECTED ( 'Calendar' ), 'Calendar'[MonthNo.] <= MAX ( 'Calendar'[MonthNo.] ) && 'Calendar'[MonthNo.] >= 3 ) ), SUM ( Sales[Sales] ) )BTW, .pbix file attached.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Apologies Pat,
I forgot to mention i have a matrix chart and there is a product Catergory on the Rows & Date in the Columns.
Your calc is very close, and is giving me the correct total but when used with the product field there is some duplication
Could you advise?
Aaron
Assuming your Sales table is many:1 with each of the Product and Date tables (and that you transformed the Sales table and made a Date column for the relationship) -
If this works for you, please mark it as solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- Anonymous6 years agoNot applicable
Hi Pat,
That still doesnt work. I have 2 tables in the model
Sales Table
calendar Table
The product field is already in the Sales Table.
You calc is doing the same as the sum and there is no running total after a certain month. Could you advise?