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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Need help with Calculated Column

Hi there,

 

 

I am creating a report in Power BI, Part of requirement I need to calculate sales by category like, wholesale, retail and franchise, 

I am using below formula . But it is not working

Error# Too many arguments were passed to the FILTER function. The maximum argument count for the function is 2

 

Calculated Column

Wholesale  = CALCULATE(SUM('Model'[Sales]), FILTER(ALL('Model'[ParentAccountID]), 'Model'[ParentAccountID] = "8411","4378", "121","2555")

1 ACCEPTED SOLUTION
Anonymous
Not applicable

 Below formula working, 

 

Wholesale = CALCULATE(
SUM('Model'[Sales]),
FILTER(
'Model',
'Model'[ParentAccountID] = "4378" ||
'Model'[ParentAccountID] = "8411" ||
'Model'[ParentAccountID] = "121"
)
)

View solution in original post

3 REPLIES 3
mattbrice
Solution Sage
Solution Sage

Try:

 

Wholesale =
CALCULATE (
    SUM ( 'Model'[Sales] ),
    FILTER (
        ALL ( 'Model'[ParentAccountID] ),
        'Model'[ParentAccountID] IN { 8411, 4378, 121, 2555 }
    )
)
Anonymous
Not applicable

Thanks for your answer @mattbrice

 

I'm getting following error

 

Function 'CONTAINSROW' does not support comparing values of type Integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.

Anonymous
Not applicable

 Below formula working, 

 

Wholesale = CALCULATE(
SUM('Model'[Sales]),
FILTER(
'Model',
'Model'[ParentAccountID] = "4378" ||
'Model'[ParentAccountID] = "8411" ||
'Model'[ParentAccountID] = "121"
)
)

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors