cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
yhael1121
Frequent Visitor

scalar value

Hi Team, 

 

Im a new user. i was working on adding a calculated column on a table but i kept on getting this error: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value. 

 

here's my calculation: Filter = ADDCOLUMNS('Table',"72Hrs",CALCULATE(AVERAGE(Compressed[72HR])))

 

 

Thanks,

Marielle

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Right, so you are adding the column to the table but then returning the entire table back. You can't do that in a calculated column or a measure. This would be a valid formula for a calculated table however.

 

Seems like you could create a new calculated column and give it this formula:

 

72Hrs = AVERAGEX(RELATEDTABLE(Compressed),[72HR])

I'm making some assumptions here. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

Right, so you are adding the column to the table but then returning the entire table back. You can't do that in a calculated column or a measure. This would be a valid formula for a calculated table however.

 

Seems like you could create a new calculated column and give it this formula:

 

72Hrs = AVERAGEX(RELATEDTABLE(Compressed),[72HR])

I'm making some assumptions here. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Hi Greg,

 

thanks for the feedback. but actually, i really dont know how to explain my situatiom. originally, i was working on a chart but was not satisfied with the result. what i would love to see with my chart is an option on what metric to show since this chart is on a daily basis. and i came accross this forum saying that we can use DAX in creating the visual that i want. now im having a much complicated issue. thank you though, i will study my dashboard more maybe i can figure this one out on my own. 

 

Thanks,

Marielle

Hi @yhael1121,

 

If you have resolved the error in your original post, would you please accept the helpful reply as an answer so that it can benefit more users? For any other problems you get during report generation, I would you suggest you post new threads on forum with detailed sample data so that we can test for you.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@yhael1121- So, typically, the best way to get a useful answer is to post some sample/example data that can be copied and pasted. This can be accompanied by screen shots of table relationships, etc. Then post a screen shot or mock-up of what you are trying to achieve. 

 

If we understand your source data and we understand what you are trying to achieve, we can generally get you a solution.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors