Forum Discussion
How to pull a balance date and master data date
- 1 year ago
Hi bweiland ,
I understand. Below is the final image of the output. Is this what you are looking for when you visual? This was done bascially by inputing an index column in the original table just like the one shown in the second image below. This was created to uniquely identify every row.
I'll leave the link to the file to check out the measures and columns. Thanks
https://drive.google.com/file/d/1EL4CyHjGUa3D__w7byn3FhXLteC-WBvX/view?usp=sharing
Hi bweiland , here's a Power Query solution you can try out by pasting it in the Advance Editor:
1. Please make sure that you have two Tables: TableBalance and TableMasterData (This Table is being referred in the TableBalance Data as you'll see in the code). Thanks. Do let me know if you have any queries regarding the same.
Here's the code:
let
TableBalance = #table(
{"Account Number", "Date", "Balance"},
{
{1, #date(2025, 1, 31), 100},
{1, #date(2025, 1, 31), 100},
{1, #date(2025, 3, 31), 200}
}
),
Transform = Table.AddColumn(
TableBalance,
"Record",
each Table.FillDown(
Table.FromColumns(
Table.ToColumns(TableMasterData) & { { _[Date] } }
),
{"Column4"}
)
),
Record = Table.TransformColumns(
Transform,
{
"Record",
each Table.FirstN(
Table.Sort(
Table.SelectRows(
Table.AddColumn(_, "Check", each [Column4] >= [Column2]),
each [Check] = true
),
{ "Column2", Order.Descending }
),
1
)
}
),
Cols = List.Transform(
List.Skip(Table.ColumnNames(TableBalance)),
each "Master " & _
),
Table = Record,
Expand = Table.ExpandTableColumn(
Table,
"Record",
{"Column2", "Column3"},
Cols
)
in
Expand
Yes, this works but it can't be displayed as measure or column so how to do incorporate the results into a visual?
- SundarRaj1 year agoSuper User
Hi bweiland ,
I understand. Below is the final image of the output. Is this what you are looking for when you visual? This was done bascially by inputing an index column in the original table just like the one shown in the second image below. This was created to uniquely identify every row.
I'll leave the link to the file to check out the measures and columns. Thanks
https://drive.google.com/file/d/1EL4CyHjGUa3D__w7byn3FhXLteC-WBvX/view?usp=sharing- v-kpoloju-msft1 year agoCommunity Support
Hi bweiland,
Has your issue been resolved? If the response provided by the community member SundarRaj, addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.If yes, kindly accept the useful reply as a solution and give us Kudos. It would be appreciated.
Thank you for your understanding!
- v-kpoloju-msft1 year agoCommunity Support
Hi bweiland,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.