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
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors