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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
ashwinkolte
Helper III
Helper III

Need help with Month over month calculation

I have input dataset like this :

 

 

ItemSub ItemMonthCost
Item 1Subitem 130-Jun-23200
Item 1Subitem 230-Jun-23300
Item 1Subitem 131-May-23400
Item 1Subitem 231-May-23600
Item 2Subitem 131-May-23500

 

 

I want to caculate Month over month cost saving  i.e June month cost - May month cost for the various items and subitems .

Require a matrix outout like this -

 

ItemSub Item30-Jun-2331-May-23Cost Saving
Item 1Subitem 1                 200400-200
Item 1Subitem 2                 300600-300
Item 2Subitem 1                    -  500-500
 Total row                 5001500-1000

I

The challenge I am facing is this .. If you see the Item 2 in the input data ,  It does NOT have any record (i.e cost)  for June month . There is May cost which is 500 . In this case I want June cost to be considered zero and cost saving calculated as (0-500) = -500 and the above matrix to be created with proper totals 

 

In other words it is as good as inserting below row in input data 

 

Item 2Subitem 130-Jun-230
2 REPLIES 2
Anonymous
Not applicable

Hi @ashwinkolte ,

Please reference the table in powerquery.

vcgaomsft_0-1693374299498.png

Select the month column and pivot.

vcgaomsft_1-1693374372486.png

vcgaomsft_2-1693374428153.png

add a custom column.

vcgaomsft_3-1693374467314.png

create a new table visual.

vcgaomsft_4-1693374540259.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Hi @Anonymous 

 

The table in question is a calculated table . Hence cannot edit in power query . Also please note that the real life data would contain many months and not just june and may

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors