The expression specified in the query is not a valid table expression.

  • The expression specified in the query is not a valid table expression.

    Posted by DSC Communities on January 2, 2020 at 5:12 pm
    • GĆ©rard Ducouret

      Member

      January 2, 2020 at 5:12 PM

      Hi,
      I tried to use the RELATED function in the formula:

      Red Sales = SUMX(FILTER(Sales; RELATED(‘Products'[Color])=”Red”);Sales[OrderQuantity] * Sales[Max Price Paid])

      but I get the Error :
      The expression specified in the query is not a valid table expression.
      What is wrong ?
      Thanks

      ——————————
      GƩrard Ducouret
      ——————————

    • Nicolas MENDEZ

      Member

      January 2, 2020 at 6:20 PM

      Hi GƩrard,

      For me it is quite strange, beacuse if the Sales table (many side) is properly connected to the products table (1 side) in the model, the formula should be working.

      But regarding to the error message, PBI is expecting a TABLE as result and not a scalar as returned by SUMX.

      I’m sorry if my question seems to be stupid šŸ™‚ , but may you confirm that the formula is written as a “New Measure” and not as “New table” ?

      Otherwise, may you give us some more details about your PBI file ?

      Hope it will help…

      ——————————
      Nicolas MENDEZ
      Datanaut & Power Bi Addict

      France – Belgium – Netherlands – Luxembourg – Switzerland
      ——————————
      ——————————————-

    • GĆ©rard Ducouret

      Member

      January 3, 2020 at 3:19 AM

      Hi Nicolas,
      You are right : The formula has been written as “New Table” šŸ™
      Thanks a lot !

      ——————————
      GƩrard Ducouret
      ——————————
      ——————————————-

    • William Skelley

      Member

      January 3, 2020 at 8:51 AM

      Hi Gerard:

      In case this helps, I have a couple possible formula alternatives attached. I believe related table(using table name) is used whenever there is a one to many relationship.

      Best regards,

      Bill

      ——————————
      William Skelley
      01106
      Longmeadow MA
      8602807221
      ——————————
      ——————————————-

    • Nicolas MENDEZ

      Member

      January 3, 2020 at 11:47 AM

      Hi all,

      You’re right Bill, the “Red Sales Alt” is the one to use ..

      I would even create 2 measures :

      Sales_Amount =Ā  SUMX(Sales,Ā Sales[OrderQuantity] * Sales[Max Price Paid])

      Red_Sales_Amount = CALCULATE([Sales_Amount] , FILTER(‘Products’ ,Ā ‘Products'[Color]=”Red”))

      ——————————
      Nicolas MENDEZ
      Datanaut & Power Bi Addict

      France – Belgium – Netherlands – Luxembourg – Switzerland
      ——————————
      ——————————————-

    • William Skelley

      Member

      January 3, 2020 at 1:26 PM

      Hi Nicolas:
      Thanks for verifying, I default to you any day on these matters.
      Take care,
      Bill

      ——Original Message——

      Hi all,

      You’re right Bill, the “Red Sales Alt” is the one to use ..

      I would even create 2 measures :

      Sales_Amount =Ā  SUMX(Sales,Ā Sales[OrderQuantity] * Sales[Max Price Paid])

      Red_Sales_Amount = CALCULATE([Sales_Amount] , FILTER(‘Products’ ,Ā ‘Products'[Color]=”Red”))

      ——————————
      Nicolas MENDEZ
      Datanaut & Power Bi Addict

      France – Belgium – Netherlands – Luxembourg – Switzerland
      ——————————

    DSC Communities replied 5 years, 8 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘The expression specified in the query is not a valid table expression.’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!