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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
lcasey
Post Prodigy
Post Prodigy

P{arameters dont work in Power BI

Nothing works in Power BI using Parameters, I have spent several days and the product simply doesnt work.

 

I am trying to do a simple task, have an end user input a date and then use that parameter in a query.

 

 

let
    Source = Sql.Database("BSASQL", "BSA00"),
    dbo_00RMOPENINVOICES = Source{[Schema="dbo",Item="00RMOPENINVOICES"]}[Data],
    #"Filtered Rows" = Table.SelectRows(dbo_00RMOPENINVOICES, each ([DOCDATE] = "&EndDate))
in
    #"Filtered Rows"

 

 

Nothing but errors no matter what I do.

 

01.png

8 REPLIES 8
Greg_Deckler
Super User
Super User

It appears that you have an extraneous or unclosed " at "&EndDate))


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Nope,

 

Sorry, Like I said this whole thing is broken.   Nothing works. Notice now I need a Token Literal.

 

 

 

01.png

 

 

Here is an example of using a parameter:

 

let
    Source = Sql.Database("localhost", "Test", [Query="SELECT * FROM dbo.Table1 WHERE Date > '" & MyDate & "'"])
in
    Source

MyDate is my parameter.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Sorry,

 

Nothing is working.  I am using your exact code and still, Power BI cant work with Dates. 

 

I am assuming your using a very old Power BI desktop that wasnt Plagued with this issue?

 

01.png02.png

My parameter was text. If your parameter is actually specified as a date, use this:

 

let
    Source = Sql.Database("localhost", "Test", [Query="SELECT * FROM dbo.Table1 WHERE Date > '" & Date.ToText(MyDate) & "'"])
in
    Source

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Aaargh,

 

Completely Useless,   Once a report is published for others in Power BI all Parameters are gone. A user has no way at all to select a parameter.

 

 

Maybee I need to open a ticket so this service gets fixed. 

Hi @lcasey,

 

According to this article/blog, currently, parameter values can only be modified within Power BI Desktop. The Product Team are actively working on ways to allow users to change parameter values within PowerBI.com for published reports consumed via the Web experience. Smiley Happy

 

Regards

I still dont understand Why Power BI is in-capable of performing Date filters.

 

Now I get an error that greater than or less than signs cant be used.  This is insane.

 

01.png02.png

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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