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
hood2media
Resolver I
Resolver I

power query | parameter query to filter data by dates (year) from google bigquery database

hi,

i get my data for period beginning 01 January 2015 from google bigquery as follows:

Source = Value.NativeQuery(GoogleBigQuery.Database()
{[Name="abc-stock"]}[Data],
"select * from abc-stock.uk.uk
where (ORIGIN='LAX' or DEST='LAX')",
null,
[EnableFolding=true])

 

note:
i have filtered the output for ORIGIN or DEST to be 'LAX'.

 

the data only date value is in the column DATE.

 

i'd like to create a parameter query that allows me to filter data for following condition examples:

1. year is > 2017

 

2. year is between 2015-2018

 

i'd appreciate any help to show me how to parameter query to filter for those condition.

tks & krgds, -nik

 

p.s.

 

separately, i have seen how power query in ms excel uses parameter table but i'm not sure if such method is available in ms power bi too.

 

 

1 ACCEPTED SOLUTION

This blog article describes the approach well, including a good M code example.

Passing Any Arbitrary Value From A Power BI Report To A Dynamic M Parameter (crossjoin.co.uk)

View solution in original post

3 REPLIES 3
hood2media
Resolver I
Resolver I

thanks for your input, @lbendlin

 

as this (sql in power bi) is still new to me, can u kindly show me an example (a dummy case will do)?

tks & kind rgds, -nik

This blog article describes the approach well, including a good M code example.

Passing Any Arbitrary Value From A Power BI Report To A Dynamic M Parameter (crossjoin.co.uk)

lbendlin
Super User
Super User

Set the parameter type to List of values.  You will need to cover both scenarios (single value provided or multiple values provided) and change your SQL statement accordingly.  Use Value.Is  to tell one from the other.

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.

Top Solution Authors
Top Kudoed Authors