locked
Syntax error with calculate function RRS feed

  • Question

  • Hello,

    i use the following function:

    Measure 1:=CALCULATE(Average([DA_NEWSLETTER_EMPFAENGER]);ALL(DA_HPFB_AgtnVDStuttgart_AlleAgtn_GVHV);[STICHTAG_DA] = DATE (2018;4;1))

    DA_HPFB_AgtnVDStuttgart_AlleAgtn_GVHV is the table

    DA_NEWSLETTER_EMPFAENGER is the column

    STICHTAG_DA is another column with a date

    hint: in german i have to use ; instead of , in the date function.

    there is still an syntay error - do you have any idea?

    Thank you!

    Martin
    • Edited by krugi Tuesday, April 10, 2018 8:31 AM
    Tuesday, April 10, 2018 8:31 AM

Answers

  • Great you made my day - it works!!!!!

    Thank you!!!!

    • Marked as answer by krugi Wednesday, April 11, 2018 12:45 PM
    Wednesday, April 11, 2018 12:45 PM
  • Hi Martin,

    Thanks for your response.

    Please kindly mark the helpful replies as answers. By doing so, it will benefit all community members who are facing this similar issues. Your contribution is highly appreciated.


    Best Regards
    Willson Yuan
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by krugi Thursday, April 12, 2018 6:09 AM
    Thursday, April 12, 2018 1:09 AM

All replies

  • Hi,

    Try this :

    Measure 1:=CALCULATE(Average([DA_NEWSLETTER_EMPFAENGER]);FILTER([STICHTAG_DA] = DATE (2018;4;1)))


    Ousama EL HOR

    [If a post helps to resolve your issue, please click the "Mark as Answer"  of that post or click Answered "Vote as helpful"  button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]


     [User Page]     [MSDN Page]     [Blog]     [Linkedin]

    Tuesday, April 10, 2018 8:46 AM
  • thank you, but i get the same error with this function

    i try to translate

    The expression is invalid or possibly incomplete. Check and correct the expression.
    Wrong syntax for ';'

    Tuesday, April 10, 2018 8:53 AM
  • Can you add the name of the table in the filter :

    FILTER('TableName';'TableName'[STICHTAG_DA] = DATE (2018;4;1))


    Ousama EL HOR

    [If a post helps to resolve your issue, please click the "Mark as Answer"  of that post or click Answered "Vote as helpful"  button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]


     [User Page]     [MSDN Page]     [Blog]     [Linkedin]

    Tuesday, April 10, 2018 9:14 AM
  • Hi Martin,

    Thanks for your question.

    If I understand your correctly, you would have to specify the table name for your [measure 1],something like below:

    Measure 1 :=
    CALCULATE (
        AVERAGE ( 'Table1'[DA_NEWSLETTER_EMPFAENGER] );
        ALL ( 'DA_HPFB_AgtnVDStuttgart_AlleAgtn_GVHV' );
        'Date'[STICHTAG_DA] = DATE ( 2018; 4; 1 )
    )

    Please replace  table name 'Table1' and 'Date' with the real table name for this syntax error.

    Best Regards
    Willson Yuan
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Wednesday, April 11, 2018 1:39 AM
  • Great you made my day - it works!!!!!

    Thank you!!!!

    • Marked as answer by krugi Wednesday, April 11, 2018 12:45 PM
    Wednesday, April 11, 2018 12:45 PM
  • Hi Martin,

    Thanks for your response.

    Please kindly mark the helpful replies as answers. By doing so, it will benefit all community members who are facing this similar issues. Your contribution is highly appreciated.


    Best Regards
    Willson Yuan
    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    • Marked as answer by krugi Thursday, April 12, 2018 6:09 AM
    Thursday, April 12, 2018 1:09 AM