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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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

 

 

Anonymous
Not applicable

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

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

bradsy
Microsoft Employee
Microsoft Employee

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors