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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Caldowd98
Helper I
Helper I

Start of previous month formula

Hi community,

 

I have a table like the example below, were i am trying to compare the difference between 2 values across months.

 

I want to see if there is a decrease between the qty at the start of this month vs the start of last month.

 

EG In the below example, i want my formula to find the first day that there is data for the previous month, and compare this against the first day there is data for the next month. (This may not always be consistent)

 

Is this possible ?

Many thanks !

 

ProductDateQTY
Product 101.02.2022700
Product 114.02.2022750
Product 101.03.2022750
Product 214.03.2022750
2 REPLIES 2
Caldowd98
Helper I
Helper I

Hi thanks for the help - i have changed the data slightly so in my raw data i have a tag against each row that is the first value for the month.

I will add this as a filter on the page, and then i want to create 2 fields. Previous month QTY & This month QTY.

I want to show in a table these values across each month.

 

I this possible with the above method ?

 

Thanks !

amitchandak
Super User
Super User

@Caldowd98 , New measures

 


//based on selecteddate or or today
previous months =
var _max = maxx(allselected('Date'), 'Date'[Date]) //or//Today()
return
calculate(sum(Table[QTY]), filter(all('Date'), 'Date'[Date] = eomonth(_max,-2)+1)

 


//based on selecteddate or or today
next months =
var _max = maxx(allselected('Date'), 'Date'[Date]) //or//Today()
return
calculate(sum(Table[QTY]), filter(all('Date'), 'Date'[Date] = eomonth(_max,0)+1)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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