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
SushiSashimi1
Frequent Visitor

Breakdown the YTD sales into monthly by item

Hi there

Can anyone help me to figure out the best way to calculate monthly sales per item if all I have is the Year to Date Sales which is cumulative? 

For example: Assuming the Year starts on Jan 21, so on Jan-21 the sales for Item A will be $10000, in Feb 21 the sales for Item A will be $500.

Period    Item Name    Year to Date Sales

Jan-21   A            $10,000.00

Jan-21   B            $2,000.00

Jan-21   C            $0.00

Jan-21   D            $500.00

Jan-21   E            $1,002.00

Jan-21   F            $999.00

Jan-21   G            $100.00

Jan-21   H            $150.00

Jan-21   I             $599.00

Jan-21   J             $3,092.00

Feb-21  A            $10,500.00

Feb-21  B            $2,500.00

Feb-21  C            $500.00

Feb-21  D            $1,000.00

Feb-21  E            $1,502.00

Feb-21  F            $1,499.00

Feb-21  G            $600.00

Feb-21  H            $650.00

Feb-21  I             $1,099.00

Feb-21  J             $3,592.00

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@SushiSashimi1 , Create date  column with help from month year

 

Date = Datevalue("01-"&[Period])

 

Then a new column

=

var _date = eomonth([Date],-1)

return

sumx(filter(Table, [Item Name] = earlier([Item Name])  && eomonth([Date],0) = _date) ,  [Year to Date Sales]) -[Year to Date Sales]

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@SushiSashimi1 , Create date  column with help from month year

 

Date = Datevalue("01-"&[Period])

 

Then a new column

=

var _date = eomonth([Date],-1)

return

sumx(filter(Table, [Item Name] = earlier([Item Name])  && eomonth([Date],0) = _date) ,  [Year to Date Sales]) -[Year to Date Sales]

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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! Prices go up Feb. 11th.

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.