Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ashmozzart
Frequent Visitor

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 4
MattAllington
Community Champion
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))



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

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?

 

 

Hi @ashmozzart,

 

As most Time Intelligence Functions (DAX) require an individual and consecutive Date table to work correctly, you may need create it using CALENDAR or CALENDARAUTO Function (DAX) if you don't have yet. And create a relationship between the Date table and your fact table with the Date column.

 

Assume your Date table is called "DateTable", then the formula to create the measure should like below.

PreviousOrders_ =
CALCULATE (
    SUM ( Sheet1[OrderAmount] ),
    DATEADD ( DateTable[Date], -1, MONTH )
)

 

Regards

This should be written as a measure, not a column. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.