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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bhmiller89
Helper V
Helper V

Filtered min function

I have production data that lists sales. I need to calculate Total Sales for anything other than the original sale. Example:

 

I have Sale Date, Sale Amount, Client Name

 

I was thinking somehow I need to use

 

DellProduction = CALCULATE([Sales Total], 'dpmgr vwJMWebSalesOpportunitiesProduction'[CloseDate] <> MINA('dpmgr vwJMWebSalesOpportunitiesProduction'[CloseDate]))

 

but keep getting an error

1 ACCEPTED SOLUTION

I too don't know what you mean by "other than the original sale", but I can tell you why you are getting an error.  The filter argument for your CALCULATE function cannot compare a column with a calculated value the way you have it set up.  It needs a hard coded value and could do it this way: 'dpmgr vwJMWebSalesOpportunitiesProduction'[CloseDate] <> "12/12/2016"

 

Otherwise, you will need to wrap the MINA function in a VALUES function.  Additionally, you may need to wrap all this inside a FILTER function, but it is impossible to test without any sample data.

View solution in original post

2 REPLIES 2

I too don't know what you mean by "other than the original sale", but I can tell you why you are getting an error.  The filter argument for your CALCULATE function cannot compare a column with a calculated value the way you have it set up.  It needs a hard coded value and could do it this way: 'dpmgr vwJMWebSalesOpportunitiesProduction'[CloseDate] <> "12/12/2016"

 

Otherwise, you will need to wrap the MINA function in a VALUES function.  Additionally, you may need to wrap all this inside a FILTER function, but it is impossible to test without any sample data.

Mi2n
Employee
Employee

What do you mean by "anything other than the original sale". Can you provide sample data and some screenshots for better understanding your problem?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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