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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
AstaBr
Helper II
Helper II

Need to get the running total and present it for each month per project.

I need to recreate a table below from an excel sheet. The highlighed column is the October month running total which comes from the pivot table (snip 2):

AstaBr_1-1732789830134.png

I am using 'Dashboard MM Active Financials' table. The column 'Dashboard_Finance Input Type' has rows of 'Planned' and 'Actual/Forecast' which corresponds to the values in column 'Dashboard_Monthly value'.
The months M1, M2... stands for fiscal months (April till previous month full Actual value). The Total Value below is the sum of all the financial year 'Actual/Forecast' values. Every month figures are updated which will go in Actual row but Forecast figure will still be counting for the future months.

AstaBr_2-1732789922719.png

I created date column in the data sheet called 'fiscalYearMonth'. 
'Dashboard_Project' column has all project names. 

'Dashboard_Monthly value' has unpivoted individual months values in 1 column.

AstaBr_3-1732793959069.png

 

4 REPLIES 4
lbendlin
Super User
Super User

I need to recreate a table below from an excel sheet.

First rule of Power BI:  Don't try to make it behave like Excel. You will fail.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information. Do not include anything that is unrelated to the issue or question.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Hi, let me try to explain it all again what needs to happen:

From the 'Dashboard MM Active Financials' table I need to have Matrix table to show every month's Project Total value (as per the snip) which needs to be lock in for each Total value. We have column for 'fiscalYearMonth' that has date in it (e.g. 01/04/2024); we have column for 'Dashboard_Month' which is sorted by Fiscal Month Order column. We have column 'Dashboard_Monthly value' that has values for each Project and is Unpivoted values (in the data set you will see Each month Name in column having the values in the rows; we have column 'Dashboard_Finance Input Type' that has rows for Planned and Actual/Forecast, out of which we only need to get values for Actual/Forecast. We need to have calculation to show like the table attached. e.g. April values for all Projects in column which we get from:
April Actual figure + the rest months (May till March) Forecasted values. Then April + May Actual values + the rest of the month’s Forecast values and so on.

 

e.g. the Total value for April is 142,475 we got this by adding the actual figure for April (32475) + 100000 (10 000 x remaining 11 months Forecast) for the rest of the months (this amount was changed later on to 15000 per month instead of forecasted 10000).
May Total value was 161887 which we got adding the actual figures for April + May + the rest of the months (10 months x 10000).
The Total value for Actual months needs to be presented individually every month to see the progress and should not get changed (needs to be locked in). The previous values should be taken for calculating future months figures but months that were locked in can't be affected by the future changes in the Forecast values.
Finally, the Planned Total value has to be added to this visual as well which will never change.

AstaBr_0-1732914810996.png

I have 2 tables in PowerBi, the original 'MM Active Financials' and its duplicated table renaimed to 'Dashboard MM Active Financials' which has Unpivoted Months £ values in 1 column named 'Dashboard_Monthly value' and all months unpivoted to column 'Dashboard_Month'. I only included small number of data due to space.

ProjectFinancial YearFinance Input TypeTotal ValueApr £May £Jun £Jul £Aug £Sept £Oct £Nov £Dec £Jan £Feb £Mar £
{pending archive} 24/25 - Takeda Vedolizumab Savings Gain Share #2024/2025 Planned126000000140001400014000140001400014000140001400014000
{pending archive} 24/25 - Takeda Vedolizumab Savings Gain Share #2024/2025 Actual/Forecast0000000000000
24/25 - Apixaban Generic2024/2025 Planned11000001000010000100001000010000100001000010000100001000010000
24/25 - Apixaban Generic2024/2025 Actual/Forecast290188324752941227562333933144029009318971500015000150001500015000
24/25 - BREDI (NR)2024/2025 Planned54999458345834583458345834583458345834584458445844583
24/25 - BREDI (NR)2024/2025 Actual/Forecast699534583458345834583195374583458345834584458445844583
24/25 - Contract Variance savings2024/2025 Actual/Forecast11267710333103401364134445-11634373518171000010000100001000010000
24/25 - Contract Variance savings2024/2025 Planned-75996-6333-6333-6333-6333-6333-6333-6333-6333-6333-6333-6333-6333
24/25 - Contract Variance savings2024/2025 Planned200000166661666616666166661666716667166671666716667166671666716667
24/25 - Contract Variance savings2024/2025 Actual/Forecast0000000000000
24/25 - Dexamethasone switch from soluble to standard tablets2024/2025 Planned15000125012501250125012501250125012501250125012501250



What is the starting month for your fiscal year?

Your first step is to unpivot the data, like so:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("tZTLTsMwEEV/ZVQ2IFHhZxwvC4WKDUKAukFdTBNDIlKnSlxAIP4du6EU8WhLH5GsO7Y8mpO5tm9vW69jY9Pc3gNWSZY/mjdg4ohJaMMNPpgUoW/SsshfJiMcwjU++q019DC3cJ1hZWCvddhiJOQQn+UnlwVaa1IfURYRQnzwdVDRrG2mg8MdkHcSN8Hi6KysTIK1+wa+2ghgM4zOOH/GIVroGWuqPFnQKUrmnZrF29X/gP1sBNOExrEPOBNKThcEZUGVjIJyzjUPSoUgTQLR03msVYCQHzAL9Svk8dVp9xz2L64O/u6bFFqHKkLGfE0RvwlfkeRnoyKt5bKq1G9RmyGdlNZVmDjoY5WjTQzUzQFfTkj9tVRTS4g3rdGpZZRHggbLhBDB4jalEQ/VueJhTmOq1jpuK8POjW0rqXUUgqiB3I1uSMnI7J8j/y1RtbZuyfjNHrOuecaRcRnWpfVFn3KXZHBXlSOoy2IyLAy4EmqHNsUqBYd+xS1o3ee9Z3LLMhi8Aw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Project = _t, #"Financial Year" = _t, #"Finance Input Type" = _t, #"Total Value" = _t, #"Apr £" = _t, #"May £" = _t, #"Jun £" = _t, #"Jul £" = _t, #"Aug £" = _t, #"Sep £" = _t, #"Oct £" = _t, #"Nov £" = _t, #"Dec £" = _t, #"Jan £" = _t, #"Feb £" = _t, #"Mar £" = _t]),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Project", "Financial Year", "Finance Input Type", "Total Value"}, "Month", "Value"),
    #"Replaced Value" = Table.ReplaceValue(#"Unpivoted Other Columns"," £"," 1 2024",Replacer.ReplaceText,{"Month"}),
    #"Changed Type" = Table.TransformColumnTypes(#"Replaced Value",{{"Value", Currency.Type}})
in
    #"Changed Type"

How to use this code: Create a new Blank Query. Click on "Advanced Editor". Replace the code in the window with the code provided here. Click "Done". Once you examined the code, replace the entire Source step with your own source.

 

 

I did mentioned before that i have 2 data tables (2nd 1 is a duplicate to unpivot the April £ 2024 - March £ 2025 values.

AstaBr_0-1732920996519.png


The starting Month of Fiscal Year is April.

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!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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