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
Anonymous
Not applicable

MDXQueryGenerator error when connecting to Power BI dataset in Power BI report builder

Hi Community,

I recenly encountered this error within the last several days when connecting to a Power BI dataset using Power BI report builder, I have the lastest version of Power BI report builder (Sep 2020). 

 

TITLE: Power BI Report Builder
------------------------------

Query preparation failed.

------------------------------
ADDITIONAL INFORMATION:

Object reference not set to an instance of an object. (MDXQueryGenerator)

------------------------------
BUTTONS:

OK
------------------------------

 

However, if I took out the RSCustomDaxFilter function in my DAX query below, it works fine. Does anyone have any suggestions on how to fix this error?

 

EVALUATE
SUMMARIZECOLUMNS (
    'Dimension Date'[Date],
    'PMC List'[PMC Name],
    'Property List'[Property Name],
    RSCustomDaxFilter(@DimensionDateDate,EqualToCondition,[Date].[Date],String),
    RSCustomDaxFilter(@PMCListPMCName,EqualToCondition,[PMC List].[PMC Name],String),
    RSCustomDaxFilter(@PropertyName,EqualToCondition,[Property List].[Property Name],String),
    "Contracted Amount", SUM('Monthly Line Item'[Contracted Amount]),
    "CountLeads", SUM ( 'Leads Summary'[CountLeads]),
    "Billed Revenue", [Billed Revenue],
    "Properties", [Properties],
    "CPL", [CPL],
    "Penetration Rate", [Penetration Rate],
    "LPP", [LPP],
    "Total Properties", [Total Properties],
    "Properties Listing", [Properties Listing],
    "ARPP", [ARPP])

 

 

7 REPLIES 7
Anonymous
Not applicable

In my experience, using dataset parameters in the Query Designer with DAX is a poor experience.  It does not seem to be able to use the parameters defined in the dataset and you must re-define them again in the Query Designer Query Parameters pop up.  Further, when I open an existing query with parameters in the Query Designer, I *always* get a message like the OP references. I don't know if this is because the Query Designer has "forgotten" that it is using DAX and not MDX (a guess based off the reference to MDX, which I have never used). 

 

The simplest work around I have used is to select the entire query, switch from DAX to MDX and back, clicking OK when it warns about losing everything, pasting the query back in, and re-creating the parameters, which are also erased.

abyrum_0-1632350620317.png

This is still occurring in 15.7.1704.1

Anonymous
Not applicable

Hi @Anonymous , Were you able to resolved this? I am getting the same error.

 

Thanks

 

 

v-shex-msft
Community Support
Community Support

Hi @Anonymous,

Did you apply any change to your system environment or Datasource/connector driver?
If this issue appears without nothing changes on your device, I'd like to suggest you contact to power bi team with your pbix file for further support.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
GilbertQ
Super User
Super User

What happens if you update it to use the code below instead of the generator?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Anonymous
Not applicable

@GilbertQ,

The code I used was modified from the codes generated by Report Builder. It worked fine until several days ago when the error started to happen.

Hi there

ANd if you run the code on the source does it work?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

If you would like to try out a pre-release build that may have a fix, I put it here. https://microsoft-my.sharepoint.com/:u:/p/bradsy/EQh132NkvCdFgIVchpz4iGgB-ZKBuAgpN3SfuaX7DVkBdQ

 

If that does not fix it, if you can provide a generic repro, we can take a look at it.

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.

Top Solution Authors
Top Kudoed Authors