Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have a table with monthly investment values by region and metrics, I need to distribute those monthly investment values into daily values. Any suggestions how I can achieve it.
Solved! Go to Solution.
Hi @Anonymous ,
Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem with yours. Thank you.
Otherwise, you can refer the solution in the following threads to achieve it:
Power Query solution:
Spreading monthly data by category across daily dates by category
DAX Solution:
Calculate daily targets based on monthly targets Sales Power bi
If the above ones can't help you get the expected result, please provide some sample data with Text format and your expected result with backend logic and special examples. Thank you.
Best Regards
A couple of examples depending on whether you want the data summarized or expanded to days.
Paste these into the advanced editor of a blank query.
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText(
"i45WMjIwMlTSUfJKzCtNLKoEskwNDAyUYnXgMm6pSUVQKXNzVCnfxKLkDCBtaGZiApSIBQA=",
BinaryEncoding.Base64
),
Compression.Deflate
)
),
let
_t = ((type nullable text) meta [Serialized.Text = true])
in
type table [y = _t, m = _t, value = _t]
),
#"Changed Type" = Table.TransformColumnTypes(
Source,
{{"y", Int64.Type}, {"m", type text}, {"value", type number}}
),
#"Added Custom" = Table.AddColumn(
#"Changed Type",
"DaysInMonth",
each Date.DaysInMonth(Date.From("1/" & [m] & Text.From([y]))),
Int64.Type
),
#"Inserted Division" = Table.AddColumn(
#"Added Custom",
"DailyValue",
each [value] / [DaysInMonth],
type number
),
#"Added Custom1" = Table.AddColumn(#"Inserted Division", "DayList", each {1 .. [DaysInMonth]}),
#"Expanded DayList" = Table.ExpandListColumn(#"Added Custom1", "DayList"),
#"Changed Type1" = Table.TransformColumnTypes(#"Expanded DayList", {{"DayList", Int64.Type}})
in
#"Changed Type1"
or this option for summarized...
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText(
"i45WMjIwMlTSUfJKzCtNLKoEskwNDAyUYnXgMm6pSUVQKXNzVCnfxKLkDCBtaGZiApSIBQA=",
BinaryEncoding.Base64
),
Compression.Deflate
)
),
let
_t = ((type nullable text) meta [Serialized.Text = true])
in
type table [y = _t, m = _t, value = _t]
),
#"Changed Type" = Table.TransformColumnTypes(
Source,
{{"y", Int64.Type}, {"m", type text}, {"value", type number}}
),
#"Added Custom" = Table.AddColumn(
#"Changed Type",
"DaysInMonth",
each Date.DaysInMonth(Date.From("1/" & [m] & Text.From([y]))),
Int64.Type
),
#"Inserted Division" = Table.AddColumn(
#"Added Custom",
"DailyValue",
each [value] / [DaysInMonth],
type number
)
in
#"Inserted Division"
| Have I solved your problem? Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;). |
Hi @Anonymous ,
Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem with yours. Thank you.
Otherwise, you can refer the solution in the following threads to achieve it:
Power Query solution:
Spreading monthly data by category across daily dates by category
DAX Solution:
Calculate daily targets based on monthly targets Sales Power bi
If the above ones can't help you get the expected result, please provide some sample data with Text format and your expected result with backend logic and special examples. Thank you.
Best Regards
Hey @Anonymous ,
there are some ways how you can "spread" your monthly values to a daily grain.
This depends on your exact requirements, if you want to distribute the monthly value to already existing daily values in another table, you will find this article helpful: Budget – DAX Patterns
If you want to transform your monthly table, into a daily table, you can use Power Query by creating a column that contains a table containing a table with all the days of the month, here you might need some extra columns, but this also works great.
Hopefully, this provides some ideas on how to tackle your challenge.
Regards,
Tom
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 56 | |
| 47 | |
| 44 | |
| 20 | |
| 20 |
| User | Count |
|---|---|
| 72 | |
| 70 | |
| 34 | |
| 33 | |
| 31 |