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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Max Date To Current Date With Filtered Status

@Dangar332 

I have physical date, Price Approved DateMaxDatePASnap.PNG and workflow status. I am needing the MAX "physical date", "Price Approved Date" with the workflow status not including "received pricing". 

How many days between the max "physical date" to 'Price Approved Date" not including the workflow status "received pricing."

 

Please advise. Thank you! 

 

I tried this code but got an error: 

 
var statusG=SELECTEDVALUE(cr93f_cpsoo[Workflow Status])
return
if(statusG="-Received Pricing",DATEDIFF(MAX(SELECTEDVALUE(cr93f_cpsoo[Physical Date]),SELECTEDVALUE(cr93f_cpsoo[PriceApproved.date]),DAY)))
 
Error: Too many arguments were passed to the MAX function. The maximum argument count for the function is 2.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

 

This dax function error occurs because you have added two fields to the Max() function.

You can use the following dax:

Measure =
IF(
    MAX('cr93f_cpsoo'[Workflow.Status])="-Received Pricing",
    DATEDIFF(
        MAX('cr93f_cpsoo'[Physical Date]),MAX('cr93f_cpsoo'[PriceApproved.date]),DAY))

vyangliumsft_0-1705313467948.png

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi  @Anonymous ,

 

This dax function error occurs because you have added two fields to the Max() function.

You can use the following dax:

Measure =
IF(
    MAX('cr93f_cpsoo'[Workflow.Status])="-Received Pricing",
    DATEDIFF(
        MAX('cr93f_cpsoo'[Physical Date]),MAX('cr93f_cpsoo'[PriceApproved.date]),DAY))

vyangliumsft_0-1705313467948.png

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Dangar332
Super User
Super User

hi, @Anonymous 

can you clear your requirnment becuase 
one you mention MAX "physical date" to "Price Approved Date"  and "physical date" to todays date with condition

not including "received pricing" .

 

and in above code you did not mention TOADY() date in entire code so i'm little confuse here

Anonymous
Not applicable

@Dangar332 

 

I apologize. It is Max "Physical Date" to "Price Approved Date" not including the status from workflow status "-Received Pricing" in Days.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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