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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

17 REPLIES 17
ashrin
Helper I
Helper I

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

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hey Expert Thanks

i Accept it

ashrin
Helper I
Helper I

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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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