Forum Discussion
MOM Error getting a straight line
- 7 years ago
Hi Anonymous,
On the chart select the 3 dots and sort by month in the PBIX file it's sort by value.
Regards,
MFelix
- Anonymous7 years ago
Got it:)
MFelix, I have found a solution for this by creating a sort column in summary Table.
DAX formula:-
YEAR('Summary Table'[EndOfMonht])*100+MONTH('Summary Table'[EndOfMonht])Thanks,Akhil.
Hi MFelix,
Thanks for response.
Sharing via ondrive:- https://nablerin-my.sharepoint.com/:u:/g/personal/akhil_j_nabler_com/EWcyrBqwH3dNqhRROiXUe4kBxhV5xlRPhIoqcP5xOiDrnw?e=Whwk3c
Iam using the SQL Jason Last N months sales post , placing the right columns in the bar chart.
Regards,
Akhil.
Hi Anonymous,
Try the following.
Add a column to your date table:
EndOfMonht = EOMONTH('Date'[Date];0) // just used to make the summary table
Add a table with the following code:
Summary Table =
FILTER(ADDCOLUMNS (
DISTINCT ( 'Date'[EndOfMonht] );
"CurrentYear"; [Sales Total];
"PreviousYear"; CALCULATE ([Sales Total]; DATEADD ( 'Date'[Date]; -1; YEAR ) ));[CurrentYear] <>BLANK())
Then add the following measures:
Sales Total = SUM(Orders[Sales])
MOM % 13 Months =
CALCULATE (
(SUM('Summary Table'[CurrentYear]) - SUM('Summary Table'[PreviousYear])) / SUM('Summary Table'[PreviousYear]);
DATESINPERIOD('Date'[Date]; MAX ('Date'[Date]); -'N'[N Value];MONTH))
Order 13 months measure =
CALCULATE (
SUM('Summary Table'[CurrentYear]);
DATESINPERIOD('Date'[Date]; MAX ('Date'[Date]); -'N'[N Value];MONTH))
Then just place them on your visual.
Not sure if this is what you need since it's adding a table, but to what I can check when adding the rolling average the context is lost for getting the previous year values. The new table only has 59 rows, so not a big number of information could work.
Check PBIX attach
Regards,
MFelix