Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Power Query only
Hi , i am trying to add to my transaction table , the price from the price list.
transactiontbl:
Customer, Date, Amount
PriceListtbl:
[From Date],[To Date],[Customer],[Price]
Thanks a head,
Solved! Go to Solution.
hi,@Veritas_D
it is the M code in the advanced editor in power query of power bi
you can paste this code in it,
By the way , these steps in the power query are:
step1.Merge table transactiontbl with table Rates
step2.add a custom column
Step3:
Expand column
Step4:Remove the column and result:
Best Regards,
Lin
hi,@Veritas_D
it is the M code in the advanced editor in power query of power bi
you can paste this code in it,
By the way , these steps in the power query are:
step1.Merge table transactiontbl with table Rates
step2.add a custom column
Step3:
Expand column
Step4:Remove the column and result:
Best Regards,
Lin
@Anonymous
Could you copy paste few rows of sample data with expected results?
@Anonymous
You can use this
let
Source = Excel.CurrentWorkbook(){[Name="transactiontbl"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Customer", type text}, {"Date", type datetime}, {"Amount", Int64.Type}}),
#"Merged Queries" = Table.NestedJoin(#"Changed Type",{"Customer"},Rates,{"Customer"},"Rates",JoinKind.LeftOuter),
#"Added Custom" = Table.AddColumn(#"Merged Queries", "Custom", each let mydate= [Date] in
Table.SelectRows([Rates],each [From Date] <= mydate and [To Date] >= mydate)),
#"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Price"}, {"Custom.Price"}),
#"Removed Columns" = Table.RemoveColumns(#"Expanded Custom",{"Rates"})
in
#"Removed Columns"
Thank you, but i meant power query of power bi
@Anonymous
Please see attached Excel File for the Steps
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 |
|---|---|
| 52 | |
| 38 | |
| 37 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 67 | |
| 34 | |
| 32 | |
| 29 |