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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
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.

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/
Anonymous
Not applicable

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

 

Anonymous
Not applicable

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/
Anonymous
Not applicable

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.