cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Total for same day last month

Hi, I am new to Power BI and am trying to create a KPI visualisation showing the number of total enquiries vs the number of enquiries we had for the same day last month.

 

i.e. Today, 24th Sept we have had 1820 enquiries since 1st Sept, I would like to have this compare to the total enquiries for 1st August - 24th August, rather than comparing against the whole previous month.

 

I have already set up my 'Total Enquiries' Measure, I am just unsure on the DAX for 'same day last month'.

 

I hope this makes sense. 

Thanks in advance. 
Lyane 

1 ACCEPTED SOLUTION

Accepted Solutions
Resident Rockstar
Resident Rockstar

HI @lgbclick

 

Hope you have the date table in your model. If not, please create and join appropriately .

 

Create Sales MTD measure for Sep month as follows:

Sales_MTD=CALCULATE(SUM(Sales_Fact.Sales),DATESMTD(Dates[Date]))

For AUg Month MTD, it will be in 2 steps:

 

 

Step 1: 
Sales_LastMonth=CALCULATE(SUM(Sales_Fact.Sales),DATEADD(Dates[Date],-1,MONTH)

Step 2: 
Sales_LMTD=CALCULATE(Sales_LastMonth,DATESMTD(Dates[Date]))

 

Hope this helps.

 

Thanks

Raj

View solution in original post

2 REPLIES 2
Resident Rockstar
Resident Rockstar

HI @lgbclick

 

Hope you have the date table in your model. If not, please create and join appropriately .

 

Create Sales MTD measure for Sep month as follows:

Sales_MTD=CALCULATE(SUM(Sales_Fact.Sales),DATESMTD(Dates[Date]))

For AUg Month MTD, it will be in 2 steps:

 

 

Step 1: 
Sales_LastMonth=CALCULATE(SUM(Sales_Fact.Sales),DATEADD(Dates[Date],-1,MONTH)

Step 2: 
Sales_LMTD=CALCULATE(Sales_LastMonth,DATESMTD(Dates[Date]))

 

Hope this helps.

 

Thanks

Raj

View solution in original post

Thanks Raj. Thats great. 

Helpful resources

Announcements
November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform October Community Highlights

Check out the top community contributors across all of the communities

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors