Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare 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 @v-cgao-msft
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
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
115 | |
112 | |
105 | |
95 | |
58 |
User | Count |
---|---|
174 | |
147 | |
136 | |
102 | |
82 |