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
rosscortb
Post Patron
Post Patron

Create a measure that shows me the previous month

Hello

 

Any ideas how i create  a measure to show the previous month count.

Thanks
Ross

 

PREVIOUS.PNG

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @rosscortb,

 

I made one sample for your reference. Please check the following steps as below.

 

1. Create a date table, and create relationship between it and the fact table.

 

date = CALENDARAUTO()

2. To create the measure to get the amount of the previous month.

 

Previous = CALCULATE(SUM(Table1[headcount]),DATEADD('date'[Date],-1,MONTH))

ppp.PNG

 

Please check the pbix as attached.

 

Regards,

Frank

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

24 REPLIES 24
Anonymous
Not applicable

Hi @rosscortb

 

Please try this formula. COUNT can be replaced by SUM based on your data nature( if your coulmn already has count then you need to use sum)..

LastMonth Headcount=CALCULATE(COUNT(Table.column1),DATEADD(Dates[Date],-1,MONTH)

 

Thanks

Raj

Hi Raj

 

Thanks for your reply. I used your code but it returns the combined total of April to November? 

 

Any ideas?

 

Ross

Anonymous
Not applicable

Is that we see your dataset (so one row per month) or you have an underlying date table with day-by-day data?

Hello,

 

I have head count table with a date column, dd/mm/yy and I have a calendar table that I created using the following link

 

https://kohera.be/blog/power-bi/how-to-create-a-date-table-in-power-bi-in-2-simple-steps/

 

Thanks


Ross

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.