Forum Discussion

stellis's avatar
stellis
Frequent Visitor
3 years ago
Solved

Argument '2' in CALCULATE function is required.

I have the following code and get this error message:
Argument '2' in CALCULATE function is required.
 
CODE:
%PO_NEU = IF(
        ISFILTERED('07_DateTable'[Month Name]),
        CALCULATE(
                 SUM('01_DC_FactTable'[Cost]),
                 MONTH('07_DateTable'[Date]) = MONTH(MAX('07_DateTable'[Date]))
                 )/
        CALCULATE(
                SUM('10_PO'[PO]),
                MONTH('07_DateTable'[Date]) = MONTH(MAX('07_DateTable'[Date]))
                ),              
        CALCULATE(
                 SUM('03_Percent PO'[DC%PO * 100]),
        ))
 
I cannot figure out what is wrong.
Thanks a lot for your help!
  • Hi,

     

    try taking out that last comma

     

    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

9 Replies

  • DOLEARY85's avatar
    DOLEARY85
    Icon for Resident Rockstar rankResident Rockstar

    Hi,

     

    try taking out that last comma

     

    If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

  • Anonymous's avatar
    Anonymous
    Not applicable
    I entered the following code and encountered this error message:  Argument '2' in CALCULATE function is required. 
     
     
    1  Next Date DD REJ =
    2  VAR _Result =
    3  MAXX(
    4           ADDCOLUMNS(
    5                    SUMMARIZE('DD rejection summ','DD rejection summ'[Customer account number],'DD rejection summ'[Account Name], 'DD rejection summ'[Date]),
    6                    "Dates",
    7                    CALCULATE(
    8                            MINX(FILTER(ALL('DD rejection summ'),'DD rejection summ'[Date] > SELECTEDVALUE('DD rejection summ'[Date])),'DD rejection summ'[Date]),
    9                             )
    10                   ), [Date])
    11  RETURN IF(ISBLANK(_Result), "", _Result)
     
    Please help identify what is wrong.
    • Ashish_Mathur's avatar
      Ashish_Mathur
      Icon for Super User rankSuper User

      Hi,

      Share some data to work with, explain the question and show the expected result.  Share data in a format that can be pasted in an MS Excel file.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Ashish, not sure my my reply did not reflected here, i already replied to your message 6 times.