Forum Discussion
Anonymous
6 years agoNot applicable
Restrict data coming from denodo
HI, I am importing data from denodo which is having data from 2010 till 2020. I want to take just the data for last 3 years from today (if 2020 is latest then 2018,2019,2020 and if 2021 is latest...
- 6 years ago
Hi Anonymous ,
You could try below M code
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("TcxBDoAwCETRu7BuQhktylka7n8NEUvs9uXPzEnocrGwUCMhbwXgEYKSmzWT8cO3OQssQPcTYyQcC9CjGNvHC8gTK5GVKLk/", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [date = _t, AMOUNT = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"date", type date}}), Custom1 = Table.SelectRows(#"Changed Type", each [date]<=List.Max(#"Changed Type"[date]) and [date]> #date(Date.Year(List.Max(#"Changed Type"[date]))-2,1,1)) in Custom1Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
6 years agoSuper User
Anonymous , refer if this can help
https://community.powerbi.com/t5/Desktop/parameterize-connection/m-p/205900#M90712
https://radacad.com/change-the-source-of-power-bi-datasets-dynamically-using-power-query-parameters
- Anonymous6 years agoNot applicable
HI Amit,
WIll this work on a date column as i want my data to be resricted by date while imorting.