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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
panipat1990
Helper III
Helper III

How to restrict data in query editor

Dear Team,

 

I am new in power bi.i have a requirement.

i have a table where 3 years data.but i want to load only 4 to 5 month's date's data..

how is possible in power bi..that it loaded only 4 to 5 month's dates data load.

how..Kindly help me its very urgent

 

Thanks

gourav

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @panipat1990,

 

I think you are talk about query parameter which create in query editor, right?

If this is a case, current query parameter can setting dynamic list from other query, but it not support setting dynamic value based on above list.

 

For your requirement, I'd like to suggest you direct use #"query name"['column name'] with list.max function to get dynamic value, then use it in filter steps.

 

Sample:

11.gif

 

Regards,

Xiaoxin Sheng

View solution in original post

17 REPLIES 17
Anonymous
Not applicable

can you be more specific ? are you saying tht the date slicer you have is not filtering a table you have ?

i want to restrict data between max_date and Before 4 month to max date in dynamic 

i made variable max_date=List.Max(Table[Sale]) And Before 4 month Ago date variable i created..

But When i set in my data filter it showing error...Kindly help me

Anonymous
Not applicable

HI @panipat1990,

 

I think you are talk about query parameter which create in query editor, right?

If this is a case, current query parameter can setting dynamic list from other query, but it not support setting dynamic value based on above list.

 

For your requirement, I'd like to suggest you direct use #"query name"['column name'] with list.max function to get dynamic value, then use it in filter steps.

 

Sample:

11.gif

 

Regards,

Xiaoxin Sheng

Hey Expert Thanks

i Accept it

Anonymous
Not applicable

Assuming that your data is in SQL, you could create a view that would result in a 4months to date data, you could then import that on to powerBI and then setup a scheduled refresh job everyday.

No Sir My Question is not related this..I made Last 4 month date stored in dateparam 

But How i apply this in my table for filtering data

So no one known that how to apply these parameter to fact table for filtering data

Phil_Seamark
Microsoft Employee
Microsoft Employee

Hi @panipat1990

 

You can apply a filter by clicking the button at the end of a column header of your date column (as per (1)) and then choose a Date Filter that suits.

 

 

image.png


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

But i want to data only maxdate. How is it possible through parameter.

So do you mean a dynamic range of dates?  eg, always the 4 months relative to the current date?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Yes Current date to last 4 month's data dynamic

I created a blank query and used the following M code and named it dateParam

 

let
    Source = Date.From(Date.AddMonths(DateTime.From(Date.StartOfMonth(DateTimeZone.FixedUtcNow())),-4))
in
    Source

This generated a single value of 1/12/2017  (d/MM/yyyy)

 

I then edited my main table to incorporate this parameter in a filter

 

    #"Filtered Rows" = Table.SelectRows(#"Changed Type1", each [Date] > dateParam)

I've attached a simple model to show it working.

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Dear Sir,

 

When i used as you sending code.it is createing error when i filter the My fact table

Expression.Error: A cyclic reference was encountered during evaluation.

Why this errror..Kindly Help me

Kindly help me Step by step.

 

From date Quries

To date Quires

 

 

How to make parameter..

 

I go parameter then kindly tell me option what i select..query list,suggested value

Kindly help me

Kindly guide me step by step i didnot understand.where i applied same step

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.