Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
I have input dataset like this :
Item | Sub Item | Month | Cost |
Item 1 | Subitem 1 | 30-Jun-23 | 200 |
Item 1 | Subitem 2 | 30-Jun-23 | 300 |
Item 1 | Subitem 1 | 31-May-23 | 400 |
Item 1 | Subitem 2 | 31-May-23 | 600 |
Item 2 | Subitem 1 | 31-May-23 | 500 |
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 -
Item | Sub Item | 30-Jun-23 | 31-May-23 | Cost Saving |
Item 1 | Subitem 1 | 200 | 400 | -200 |
Item 1 | Subitem 2 | 300 | 600 | -300 |
Item 2 | Subitem 1 | - | 500 | -500 |
Total row | 500 | 1500 | -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 2 | Subitem 1 | 30-Jun-23 | 0 |
Hi @ashwinkolte ,
Please reference the table in powerquery.
Select the month column and pivot.
add a custom column.
create a new table visual.
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