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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
lgbclick
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
Anonymous
Not applicable

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
Anonymous
Not applicable

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

Thanks Raj. Thats great. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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