Quantcast
Channel: Developer topics
Viewing all articles
Browse latest Browse all 18121

Combine inline function in query

$
0
0

Hi,

I'm trying to create a custom function and use it in a query. I'm able to create a function in PBI Desktop and then use it in query, but i need to comibne it in a query so instead:

let Source = OData.Feed("https://qa-api.mspmanager.com/odata"),
Bills_table = Source{[Name="Bills",Signature="table"]}[Data],
Result = Table.AddColumn(Bills_table, "MapValue", each Map(_[AmountBilled]))
in
Result

 

where Map is my function, I want to combine this with query. Is this achievable ?

 

 

let Map = (val as number) => if val > 10 then "a" else "b" <-- some functino defined before rest of query
let Source = OData.Feed("https://qa-api.mspmanager.com/odata"), Bills_table = Source{[Name="Bills",Signature="table"]}[Data], Result = Table.AddColumn(Bills_table, "MapValue", each Map(_[AmountBilled])) in Result

Viewing all articles
Browse latest Browse all 18121

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>