Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not 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 year then 2019,2020,2021)

 

 I see there is a a option in dropdown to  select  "is in the previous" but it selects data 2017,2018,2019 instead of 2018,2019,2020.

 

Is there any way to do it ?

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

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
    Custom1

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
dax
Community Support
Community Support

Hi @Anonymous , 

You could refer to my sample for details.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi Zoe,

 

Thanks for your quick help.

The solution you provided looks good but i want to do this filterization on data  when i am importing data from denodo server which is in power query.

Not sure if this will work there

dax
Community Support
Community Support

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
    Custom1

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super 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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

HI  Amit,

 

WIll this work on a date column as i want my data to be resricted by date while imorting.

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors