Forum Discussion
MOM and QOQ Filters Calculation
Hi,
I have a graph which compares Customer Name on the Y_Axis and SalesAmount on the X_Axis.They need a MOM and QOQ filters.What exactly QOQ/MOM i am referring is when i select a month in the filter it should compare SalesAmount that month and just its previous month for every customer.For Example if i select 2016 Jan,It should compare 2016 Jan and 2015 Dec salesAmounts for every customer. Samething for Quater also.Is it possible in powerBI?What are the DAX calculations should i use?Thanks in Advance.
4 Replies
- MattAllington
Community Champion
You can use the dateadd function like this
Total Sales = sum(table[sales column])
total sales prior month = calculate([total sales], dateadd(calendar[date],-1,month))
you need a calendar table http://exceleratorbi.com.au/power-pivot-calendar-tables/
the quarter calc depends what you need (e.g. Is it a rolling quarter or fixed quarter?)
total sales prior quarter = calculate([total sales], dateadd(calendar[date],-1,quarter))
- ashmozzartFrequent Visitor
Hi,
Thanks a lot for the reply.
When i created a derived column using below Dax,
PreviousOrders_ = CALCULATE(SUM(Sheet1[OrderAmount]),DATEADD(Sheet1[BillStartDate],-1,MONTH))
I am getting an empty with no data.May i know why?
- MattAllington
Community Champion
This should be written as a measure, not a column.