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
Addams_Katherin
New Member

Dataset query error in report builder

Hi ,

 

I am using report builder to connect to a power BI dataset. when I use the following DAX query, then it throws an error. does anyone know how to fix it?

 

 

EVALUATE
VAR a = 
        SUMMARIZECOLUMNS (
            'table1'[id],
            'table2'[cid],
            RSCustomDaxFilter(@CDate,EqualToCondition,[CycleDate].[Date],DateTime),
            "MTD Sub ANP", [MTD Sub ANP],
            "Flag", 0,
            "Order",FORMAT(VALUE(MAX('CHANNEL'[Order])) , "#00.0")
        )

VAR b = 
        SUMMARIZECOLUMNS (
            'table1'[type_id],
            'table2'[cid],
            RSCustomDaxFilter(@CDate,EqualToCondition,[CycleDate].[Date],DateTime),
            "MTD Sub ANP", [MTD Sub ANP],
            "Flag", 0,
            "Order",FORMAT(4.5 , "#00.0"),   
            FILTER(CHANNEL , CHANNEL[ID] in {5,6}))
)
return
UNION(a,b)

 

 

thanks.

4 REPLIES 4
Sahir_Maharaj
Super User
Super User

If the error still persists, please provide more details about the error message so I can try to help you better. 

 

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

 

 


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 13K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
Sahir_Maharaj
Super User
Super User

Here's the corrected code:

 

EVALUATE
VAR a =
SUMMARIZECOLUMNS (
'table1'[id],
'table2'[cid],
RSCustomDaxFilter(@CDate,EqualToCondition,[CycleDate].[Date],DateTime),
"MTD Sub ANP", [MTD Sub ANP],
"Flag", 0,
"Order",FORMAT(VALUE(MAX('CHANNEL'[Order])), "#00.0")
)

VAR b =
SUMMARIZECOLUMNS (
'table1'[type_id],
'table2'[cid],
RSCustomDaxFilter(@CDate,EqualToCondition,[CycleDate].[Date],DateTime),
"MTD Sub ANP", [MTD Sub ANP],
"Flag", 0,
"Order",FORMAT(4.5 , "#00.0"),
FILTER(CHANNEL , CHANNEL[ID] in {5,6})
)
return
UNION(a,b)

 

 


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 13K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
Sahir_Maharaj
Super User
Super User

The error you're encountering might be due to a syntax error in the DAX code. It looks like there's an extra parenthesis at the end of the code.

 


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 13K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
jaweher899
Super User
Super User

 

Here are some suggestions to help resolve the issue:

  1. Ensure that the columns in the 'table1' and 'table2' referenced in the DAX query exist and are spelled correctly.
  2. Verify that the RSCustomDaxFilter function is defined and its arguments are correct.
  3. Ensure that the @cdate variable is defined and its value is valid.
  4. Ensure that the EqualToCondition in the RSCustomDaxFilter function is spelled correctly and used correctly.
  5. Check that the [CycleDate].[Date] and DateTime used in the RSCustomDaxFilter function are defined and match the data type of the referenced data.
  6. Check the syntax of the UNION function, making sure that the number and type of columns in each of the input tables (a and b) match.
  7. Verify that the CHANNEL table used in the FILTER function is defined and its columns (e.g. ID) exist and are spelled correctly.

Can you please share some examples of data? can you put the error that you get?

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.