cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
mcody
Frequent Visitor

Modify SQL query paramters from Report running on service

Hi,

Would likre report user to be able to change start/end date for report (on service) and send parameters to SQL to retrieve dataset.

 

I can add parameters on Power BI desktop but cannot figure out how to add parameter to report and send to SQL.

 

Is this possible?

 

We are running Power BI Pro.

 

Thanks

1 ACCEPTED SOLUTION

Hey @mcody ,

 

what you are looking for is not possible, as @Bamak already mentioned. Parameters are not an interactive feature, and for this: using dataflows will be of no help.

 

Consider using directquery, here data "remains" inside the source system. But be aware, that this means you need a star schema (this means a dwh), if you have to avoid importing all possible data.

 

Regards,

Tom 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

3 REPLIES 3
Bamak
Helper V
Helper V

Hi mcody

 

  • On repport you manage dynamic filters (Whatever the content of the dataset , based on tables relationships)
  • On PBI service , you can manage query (lg M) parameters  value via DATASET parameters

Here, obviously we are not on something which must be handled by the users of the reports, but controlled by the manager of the dataset
The goal is to optimize the number of lines returned by the query (type folding) to the source
I advise to look at the mechanics set up for the incremental ETL (available for pro for 2 weeks)

 

A Query M sample :

let
Source = Sql.Database("XXXXXXXX", "YYYYY"),
dbo_DimProduit = Source{[Schema="dbo",Item="DimProduit"]}[Data],
#"Lignes filtrées" = Table.SelectRows(dbo_DimProduit, each [ProduitCode] = codeProduit)
in
#"Lignes filtrées"

 

This will generate the folding SQL request (show native query)

select [_].[Produit_PK],
[_].[ProduitCode],
[_].[Produit],
[_].[SousFamilleCode],
[_].[SousFamille],
[_].[FamilleCode],
[_].[Famille],
[_].[URL_Photo_famille],
[_].[Valide]
from [dbo].[DimProduit] as [_]
where [_].[ProduitCode] = 'LL1100'

 

Regards

 

Christophe 

mcody
Frequent Visitor

Hi Christophe,

 

Thanks for reply.

 

Is the functionality you mention only available on Premium? We are on Pro only.

 

 

I would like the user to interact with the parameter, pick date, date goes to SQL, data for just that date comes back.

Reuirement is to be able to pick one date form  a number of years data, so to import all possible data to service and use a slicer is not practical.

 

 

I have done this for paginated report using Report Builder, but these reports cannot be published to service - as far as I know.

 

I am wondering would Power BI dataflow work for this type of application? I see it looks like it is possible to add parameters to a dataflow.

 

Have you used these?

 

Thanks,

Michael

 

Hey @mcody ,

 

what you are looking for is not possible, as @Bamak already mentioned. Parameters are not an interactive feature, and for this: using dataflows will be of no help.

 

Consider using directquery, here data "remains" inside the source system. But be aware, that this means you need a star schema (this means a dwh), if you have to avoid importing all possible data.

 

Regards,

Tom 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors