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.
I'm trying to make a measure like that, how can I correct it?
Avg ProductID+OrderID = AVERAGEX(VALUES(Products[ProductID]), CALCULATE(AVERAGE('Order Details'[OrderID]), CALCULATE(AVERAGE(Products, Products[UnitPrice]) * (1-[Total Discount]))))
ERROR Too many arguments were passed to the AVERAGE function. The maximum argument count for the function is 1.
Hi @selected_ ,
Average() only allows one parameter and AverageX() allow two parameter, they are defined by DAX syntax.
Based on your formula, not certain what you want to calculate and what your expected result is, seems need more information about this issue for further discusssion like some sample data, screen shots etc. which can let community members better to help you to solve this issue.
Best Regards,
Yingjie Li
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.
@selected_ , Try like
Avg ProductID+OrderID = AverageX(Summarize('Order Details','Order Details'[OrderID],Products[ProductID], "_1",CALCULATE(AVERAGE(Products, Products[UnitPrice]) * (1-[Total Discount]))),[_1])
Avg ProductID+OrderID = AVERAGEX(VALUES(Products[ProductID]), CALCULATE(AVERAGE(Products, Products[UnitPrice]) * (1-[Total Discount]) Values('Order Details'[OrderID])))
Use this measure @selected_
Avg ProductID+OrderID =
AVERAGEX(
VALUES( Products[ProductID] ),
CALCULATE(
AVERAGE( 'Order Details'[OrderID] ),
CALCULATE(
AVERAGE( Products[UnitPrice] ) * ( 1 - [Total Discount] )
)
)
)
You had this:
AVERAGE(Products, Products[UnitPrice])
You cannot do that, and it was complaining about the two parameters, and AVERAGE() only takes one, a single column.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI Reporting
your code give me error
A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed.
Yeah, I have no data to test with @selected_ and I am not sure what your formula is even doing. Why is it averaging the order ID for example?
I just gave you something syntactically correct. Please provide data and what your goal is.
How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingCovering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
77 | |
68 | |
54 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |