cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ManuelEspitia
Helper II
Helper II

It doesn't allow me to select columns to create new measure

Hello everyone!

I'm trying to create a "Available UCI Beds" measure that subtracts two columns, a column called "Total UCI Beds" minus another "Covid 19 Occupied UCI Beds" but doesn't give me the option to select them. When I try to write them I get a message "Failed to resolve name 'beds'. It is not a valid table, variable, or function name".

Does anyone know how I can solve it?Captura1.JPGCaptura2.JPG

1 ACCEPTED SOLUTION
RicoZhou
Community Support
Community Support

Hello @ManuelEspitia

In additon to lkalawski's response,when constructing a measure, it is necessary to use the sum function to add the number type column.

You must create a measure as follows:

Measure = Sum(Table(Total UCI Beds))-Sum(Table(Covid 19 Occupied UCI Beds))

And you'll get the result, but you can't see the result in the data view. You must create a visual to display the result of the measure.

If you want to use the columns to calculate the result directly and display the result in the data view, you can create a calculated column.

Calculated Column = Table(Total UCI Beds)-Table(Covid 19 Occupied UCI Beds)

For more information in Calculated Column and Measure:

Walkthrough: Create Calculated Columns in Power BI Desktop

Tutorial: Create your own measurements in Power BI Desktop

Calculated columns vs. measurements

Best regards

Rico Zhou

If this post helps,then consider Accepting it as the solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
RicoZhou
Community Support
Community Support

Hello @ManuelEspitia

In additon to lkalawski's response,when constructing a measure, it is necessary to use the sum function to add the number type column.

You must create a measure as follows:

Measure = Sum(Table(Total UCI Beds))-Sum(Table(Covid 19 Occupied UCI Beds))

And you'll get the result, but you can't see the result in the data view. You must create a visual to display the result of the measure.

If you want to use the columns to calculate the result directly and display the result in the data view, you can create a calculated column.

Calculated Column = Table(Total UCI Beds)-Table(Covid 19 Occupied UCI Beds)

For more information in Calculated Column and Measure:

Walkthrough: Create Calculated Columns in Power BI Desktop

Tutorial: Create your own measurements in Power BI Desktop

Calculated columns vs. measurements

Best regards

Rico Zhou

If this post helps,then consider Accepting it as the solution to help other members find it more quickly.

View solution in original post

lkalawski
Super User
Super User

Hi @ManuelEspitia 

When creating a measure, you must use an aggregate function to get the data into columns.
In your case, create a calculated column and subtraction will work.

 

More information about measures and calculated columns: https://www.sqlbi.com/articles/calculated-columns-and-measures-in-dax/



_______________
If I helped, please accept the solution and give kudos! 😀

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.