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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AstaBr
Helper II
Helper II

How to create a summary table for each month running total for fiscal year

Hi,

I have a data table called 'MM Active Financials' and manually created 'DateTable' connected with relationship.

The 'Projects' has Planned' and 'Actual/Forecast' values entered monthly, both of them sits under 'Finance Input Type' column . Financial year starts from Aprl - March. I need to recreate a Summary table (snip attached) of Pivot table used before to show all months (From April till previous month as we present findings for completed months only) with the 'Total Value' column from 'Actual/Forecast'. 

We need to create a automated process for current months to appear automatically please.

Actual_Forecast Pivot.PNGForecat from Target.PNGDateTable.PNG

Not sure if the relationship is correctly linked:

Relationship table.PNG

 

Project Reference (Project) (Project)ProjectEstimateMonths To LockFinancial YearPhasing start dateFinance Input TypeTotal ValueApr £May £Jun £Jul £Aug £Sept £Oct £Nov £Dec £Jan £Feb £Mar £YTD
R1K-ISCR-2023-001124/25 - Apixaban Generic 42024/2025 01/04/2024Planned1100000100001000010000100001000010000100001000010000100001000060000
R1K-ISCR-2023-001124/25 - Apixaban Generic12000042024/2025 01/04/2024Actual/Forecast290188324752941227562333933144029009318971500015000150001500015000215188
R1K-SURP-2024-000324/25 - BREDI (NR) 42024/2025 01/04/2024Planned5499945834583458345834583458345834583458445844584458332081
R1K-SURP-2024-000324/25 - BREDI (NR)042024/2025 01/04/2024Actual/Forecast69953458345834583458319537458345834583458445844584458347035
R1K-SURP-2024-000124/25 - Contract Variance savings042024/2025 01/04/2024Actual/Forecast11267710333103401364134445-1163437351817100001000010000100001000062677
R1K-SURP-2024-000124/25 - Contract Variance savings 42024/2025 01/04/2024Planned-75996-6333-6333-6333-6333-6333-6333-6333-6333-6333-6333-6333-6333-44331
R1K-SURP-2024-000124/25 - Contract Variance savings 42024/2025 01/04/2024Planned200000166661666616666166661666716667166671666716667166671666716667116665
3 REPLIES 3
Anonymous
Not applicable

Hi @AstaBr ,

 

First we may need to consider doing some transformations to the source table, please refer to the following steps:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("tZTfS8MwEMf/lbInhZXd5S5J8zjnD4Ygo0Nfxh5iLVIYnXRV/PPNZRP2MJ3tZih875prLp/m2y4Wgxzv0+l8kqcKFKUAiIPhQPFI6SRNxm/Vp3/2dXJX1mVTFWEqXCwVIDWgdIgBRxATmZitfF2XLyFChDBkXpJdfG41UZfD7iCodkv8ijMu2ne/Gt2um7Lwm1ZKHWCWhYAUWx1vMCpRq40oETkSRWbYPgAu5pmz0ljvEI6oQi2Nvtnmj/lM2DiwAe2xXeU319Pk4iG/7HQ8mp2TbbHOqKfwIYnoCjLsuPMeR2Gc08e2iaHE9mFgC6QPM+w7a7Ku28YXbfLkm8rXRZls/EdVv276ISEqY6NLIPhoq9FFSIalLzGzrJMiGpI1yJLkmKHt8t3ENifR/d1qqdXOGQnMFurflJnoB+OdHyv+QOJLNWEcUXuKShC8uPwC", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Project Reference (Project) (Project)" = _t, Project = _t, Estimate = _t, #"Months To Lock" = _t, #"Financial Year" = _t, #"Phasing start date" = _t, #"Finance Input Type" = _t, #"Total Value" = _t, #"Apr £" = _t, #"May £" = _t, #"Jun £" = _t, #"Jul £" = _t, #"Aug £" = _t, #"Sept £" = _t, #"Oct £" = _t, #"Nov £" = _t, #"Dec £" = _t, #"Jan £" = _t, #"Feb £" = _t, #"Mar £" = _t, YTD = _t]),
    #"Removed Columns" = Table.RemoveColumns(Source,{"Total Value", "YTD"}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Removed Columns", {"Project Reference (Project) (Project)", "Project", "Estimate", "Months To Lock", "Financial Year", "Phasing start date", "Finance Input Type"}, "Attribute", "Value"),
    #"Added Custom" = Table.AddColumn(#"Unpivoted Other Columns", "Date", each let
month = Text.Replace(Text.Split([Attribute]," "){0},"Sept","Sep") ,
year = Text.Split([Financial Year],"/"),
result = if List.Contains({"Jan","Feb","Mar"},month) then year{1} & "-" & month & "-" & "1" else year{0} & "-" & month & "-" & "1"
in
result),
    #"Changed Type" = Table.TransformColumnTypes(#"Added Custom",{{"Estimate", Int64.Type}, {"Months To Lock", Int64.Type}, {"Phasing start date", type date}, {"Value", Int64.Type}, {"Date", type date}}),
    #"Added Custom1" = Table.AddColumn(#"Changed Type", "Finance Input Type2", each let 
month = Date.Month([Date]),
fiscalmonth = if month < 4 then 9+month else month-3,
result = if [Finance Input Type] <> "Planned" then [Finance Input Type] & " M" & Text.From(fiscalmonth) else [Finance Input Type]
in 
result),
    #"Added Custom2" = Table.AddColumn(#"Added Custom1", "Finance Input Type2 Order", each if [Finance Input Type] <> "Planned" then let month = Date.Month([Date]),fiscalmonth = if month < 4 then 9+month else month-3 in fiscalmonth else 0)
in
    #"Added Custom2"

vcgaomsft_0-1730959445924.png

And then create a new measure:

Measure = 
VAR __date = EOMONTH(TODAY(),-1)
VAR __max_date = MAX('MM Active Financials'[Date])
VAR __cur_type = SELECTEDVALUE('MM Active Financials'[Finance Input Type2])
VAR __result = IF( __cur_type="Planned" || __date>=__max_date, SUM('MM Active Financials'[Value]))
RETURN
__result

vcgaomsft_1-1730960344765.png

Attached is the pbix file for reference, hope this helps.

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

I forgot to say that I had to duplicate the 'MM Active Financials' table due to Unpivoting. I have other created tables that I need individual Months (Apr £, May £, etc) as well as YTD for monthly figures to be presented. By duplicating tables, i am worried that the relationship might not work correctly going forward.
1.PNG

Hi and thank you so much for trying to help @Anonymous ;

I managed to recreate your steps on my dashboard however, the totals you are getting is only the monthly values while i need a running total for each month which needs to have the Total Actual values and Forectastes values showing. Please see the snip attached maybe that will explain more:
Total values.PNG

My recreated measure from you is:

Measure =
VAR __date = EOMONTH(TODAY(), -1)
VAR __max_date = MAX('MM Active Financials (2)'[Date])
VAR __cur_type = SELECTEDVALUE('MM Active Financials (2)'[Finance Input Type2])
VAR __result =
    IF(
        __cur_type = "Planned" || __date >= __max_date,
        SUM('MM Active Financials (2)'[Value])
    )
RETURN
__result

Please could the 'Total' column at the end not be included, not sure how it came as i did try using your steps. Also, If 'Planned' could be at the front:
Snip of all page.PNG
I am very gratful for your help.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.