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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Direct Query Oracle DB with dynamic parameters

I'm using direct query in several reports.

Usually , when I request dynamic query , I put parameters in the select statement (as in the below example) :

------------------------------------------------------------------------------------------------------------------------------

Origine = Oracle.Database("Server_Names", [HierarchicalNavigation=true, Query="select *  from Table1 where Table1.Date(YYYYMMDD format) > = "&Number.ToText((Date.Year(DateTime.LocalNow()) *10000) + (Date.Month(DateTime.LocalNow()) *100) + 1)&"   ", CreateNavigationProperties=false])
-------------------------------------------------------------------------------------------------------------------------------

With this variable I'm able to get all the rows that have a date >= beginning of the current month.

I face isssue when I publish my report because  it seems that the variable is not updated when I move to the next Month.

Anybody have some idea regarding the possible solution?

Status: Needs Info
Comments
Anonymous
Not applicable

Hi @beppe_62 

You enter the formula in the input box marked in my screenshot ? 

 

Ailsamsft_0-1662707503121.png

You mentiond that the variable is not updated when you move to the next Month , how didi you move to the next month ? Did it update in Desktop ? Can you explain it in videos ? It's a bit difficult for me to restore your scene .

 

Best Regards,
Community Support Team _ Ailsa Tao

 

beppe_62
Advocate II

I simply said that when I published my report in the Service,  It's no clear when and how the variable it's updated based on the real time date (consider I m in a direct query scenario)