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

See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap

Reply
stellis
Frequent Visitor

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!
1 ACCEPTED SOLUTION
DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

try taking out that last comma

 

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

View solution in original post

9 REPLIES 9
Gemma
Frequent Visitor

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.

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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

here's sample details pls. I screenshot, hope this will work. 

i entered the above mentioned code in Power BI Desktop but in Next Date DD REJ column I encountered an error, Argument '2' in CALCULATE function is required. 

Let me know if there's a need for further details. thank you so much for the help

 

Gemma_1-1720162048014.png

 

Here's the details please.

Account Name   Customer account number     Date DD REJ       Prev Date DD REJ     Next Date DD REJ

Solaire                12619154                                 7/1/2024                                          shld be 7/2/2024- 

Solaire               12619154                                  7/2/2024            7/1/2024                 shld be 7/3/2024- 

Solaire               12619154                                 7/3/2024            7/2/2024

With just that much information, I cannot help you.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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

stellis
Frequent Visitor

Thanks so much!

No problem 🙂

DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

try taking out that last comma

 

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

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.