Pass parameter value to query before running in power bi

1

I am looking for a query to extract data from sql but I would like to know if power bi has the functionality of passing the value of a parameter in for example: start date and end date to the query and that this value is captured by the user before if the query is executed, it is similar to what Reporting Services has, where it is very easy to generate the date parameters and automatically pass them to the query.

select CARLINE,veh_numserie AS SERIE,veh_anmodelo as MODELO,VENDEDOR,VENTA,VTE_FECHDOCTO AS FECHAFACTURA ,
VTE_STATUS AS ESTATUS,VTE_DOCTO AS FACTURA,COSTO,pen_isan AS ISAN,SUBTOTAL AS PRECIO,TOTAL,CLIENTE , CIUDAD ,
CANT=CASE WHEN SUBTOTAL >=0 THEN 1 ELSE -1 END 
from libroventas where convert(datetime, vte_fechope,103) between 
convert(datetime,'01/01/2018',103) and convert(datetime,'01/04/2018',103) 
VENTA NOT LIKE 'INTERCAMBIO%' AND LIB_CVEUSU='GMI' ORDER BY 1
    
asked by PAPI PAPI 25.04.2018 в 01:47
source

1 answer

0

Something similar to Reporting Services, you can not find it in Power BI Desktop. Now, in the report that is generated, you can define a pair of filters or Slicers where the user indicates, and consulting the report, that filters through the two fields that you indicate and obtain their data.

I understand, although I have not used it, that there is a way to indicate it in the Power Query component associated with Power BI Desktop, to generate a new query, but this is not at the runtime as you require, but at design time .

Something about the above on this Web page: link

    
answered by 05.07.2018 в 16:52