March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
How should I modify the function below to avoid the error message.
Hi @asanteza
Can you please present sample of the shape of the expected results?
Hi @asanteza ,
When you use the function SUMMARIZE, it will return a table instead of a value. You can get more detail about the function SUMMARIZE in this official documentation. You can update the formula of measure as below and check if it can return your expected result... Please find the details in the attachment.
Measure =
VAR _tab =
SUMMARIZE (
Productivity,
Productivity[employee name],
"AvgOfgrade",
CALCULATE (
AVERAGE ( Productivity[grade awarded] ),
Productivity[employee name] = EARLIER ( Productivity[employee name] )
)
)
RETURN
AVERAGEX ( _tab, [AvgOfgrade] )
If the above one can't help you, could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Error: The syntax for 'RETURN' is incorrect.
So sorry for the bother.
Hi @asanteza ,
It seems that you got some error message when you used the formula which I provided... Could you please provide some raw data in your tables (exclude sensitive data) with Text format, the screenshot with the error message and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
hi @asanteza
try like:
Error:
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
Got the error:
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
hi @asanteza
are you expecting something like this:
Measure = AVERAGEX( VALUES(Productivity[employee name]), Productivity[grade awarded] )
if not, could you describe your expectation on the measure?
error:
A single value for column 'grade awarded' in table 'Productivity' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
hi @asanteza
try like:
Measure = AVERAGEX( VALUES(Productivity[employee name]), SUM(Productivity[grade awarded]) )
please consider @someone, if you seek further suggestions.
No error returned but does not list any names of employees.
Hi,
I am not 100% sure if the below DAX formula can provide the desired output of the calucaluted table, but please try something like below.
DAX sample =
SUMMARIZE (
GROUPBY ( Productivity, Productivity[employee name] ),
"AvgOfgrade", AVERAGE ( Productivity[grade awarded] )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
No error but does not return employee name. Please modify it to also show employee name.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
22 | |
19 | |
16 | |
9 | |
5 |
User | Count |
---|---|
37 | |
29 | |
16 | |
14 | |
12 |