Forum Discussion
Previous Month to Date
Hi I have a issue with Matrix table sub total,
I have craeted below measures
cham Try:
Measure Total = VAR __Total = SUMX(SUMMARIZE('Table',[End of Month],"__PrevMonth",[PreviousMonthMeasure]),[__PrevMonth]) RETURN IF(HASONEVALUE('Table'[End of Month]),[PreviousMonthMeasure],__Total)
12 Replies
- Greg_Deckler
Community Champion
cham You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000
Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.
https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TITHW/m-p/434008In your case, maybe:
Amount Sales = SUM(Sales[Amount]) Prev Month To Date = VAR __Date = MAX('Calendar'[Date]) VAR __PreviousMonth = DATE(YEAR(__Date),MONTH(__Date)-1,DAY(__Date)) VAR __FirstOfPrevMonth = DATE(YEAR(__PreviousMonth),MONTH(__PreviousMont),1) RETURN IF([MTH]=1, 0, CALCULATE ([Amount Sales], Calender[Date]>=__FirstOfPrevMonth, Calendar[Date]<=__PreviousMonth)) Sales Amount Mth = [Amount Sales] - [Prev Month To Date]- cham
Post Patron
Hi Greg_Deckler
The amount which are showing for each month is corrcet. The issue I am having is total for each year.
Ex: 2019 Total value is not the SUM of the 2019 Months Value.
Can you please help for this issue?
Thanks
- Greg_Deckler
Community Champion
cham Oh, I misread. This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907