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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
fsadiq
Frequent Visitor

Split a value across 12 months/A year

Hi All,

I have a table from a SharePoint List as shown below

fsadiq_3-1700642627899.png

 

What i want is to split the Priority_Amount into 12 Months/1 Year as shown below by leveraging the year of any of the Urgent_date value which is basically 2024 all through.

fsadiq_2-1700642508023.png

 

Thank you.

 

8 REPLIES 8
Syndicate_Admin
Administrator
Administrator

You need to use the Advanced Editor to paste the code.

Syndicate_Admin
Administrator
Administrator

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckktKFFwVNJRMjUwMABShvqG+kYGRiYgplKsDlSBE5BrgqHACKHAGcg1xlBgjFDgAlKPocBEKTYWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Select = _t, Priority_Amount = _t, Urgent_Date = _t, ID = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Select", type text}, {"Priority_Amount", Currency.Type}, {"Urgent_Date", type date}, {"ID", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each {0..11}),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom"),
    #"Replaced Value" = Table.ReplaceValue(#"Expanded Custom",each [Urgent_Date],each Date.AddMonths([Urgent_Date],[Custom]),Replacer.ReplaceValue,{"Urgent_Date"}),
    #"Replaced Value1" = Table.ReplaceValue(#"Replaced Value",each [Priority_Amount],each [Priority_Amount]/12,Replacer.ReplaceValue,{"Priority_Amount"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Replaced Value1",{{"Priority_Amount", Currency.Type}, {"Urgent_Date", type date}}),
    #"Removed Other Columns" = Table.SelectColumns(#"Changed Type1",{"Select", "Priority_Amount", "Urgent_Date", "ID"})
in
    #"Removed Other Columns"

Thanks @Syndicate_Admin .

I tried running the query. Not sure if i applied the codes the right way but i created a blank query and pasted the codes but i rather got the below (Image)

fsadiq_0-1701054757901.png

Thank you once again.

Syndicate_Admin
Administrator
Administrator

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to 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.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Thank you @Syndicate_Admin .

My table is as shown below:  Table1

SelectPriority_AmountUrgent_DateID
Dept A50001/1/20241
Dept B40001/1/20242
Dept C30001/1/20243
Dept D20001/1/20244

 

And i simply would like to achieve the below (Dividing the Priority_Amount by 12 (1 Year);

Department2024-012024-022024-032024-042024-052024-062024-072024-082024-092024-102024-112024-12ID
Dept A4174174174174174174174174174174174171
Dept B3333333333333333333333333333333333332
Dept C2502502502502502502502502502502502503
Dept D1671671671671671671671671671671671674

Where i can still reference the table 1 with the newly created Table.(ID).

 

Thanks

fsadiq
Frequent Visitor

Hi @Syndicate_Admin I really don't have a calendar table. I am just hoping to use the year of the Urgent_Date column. I haven't done anything yet.

 

Thanks 

Syndicate_Admin
Administrator
Administrator

That seems straightforward. You have a calendar table, right?  What have you tried and where are you stuck?

Hi , I was able to create a date table to capture and divide the value by 12 Months.

The issue now is that it does not filter when i make selection simply because there is no connection between the Date Table and Main Table.

i took below steps:

1. I created a date Table and added a column with the below

Priority Amount = 
var _start=DATE(2024,1,1)
var _value=[Priority]
var _end=EOMONTH(_start,11)
return IF('Date'[Date]>=_start&&'Date'[Date]<_end && DAY('Date'[Date])=1,_value/12)

Where priority is a calculated DAX measure from the below table.

Priority = sum(Unit_UrgentNeed[Priority_Amount])

fsadiq_0-1700739861289.png

I was able to get the below:

fsadiq_1-1700740182291.png

 

If i add a slicer, and include Title column, If i select any of the title values, it does not filter the new date table.I guess a relationship needs to be created within this 2 Tables.

Thanks in Anticipation.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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