Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

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
v-rzhou-msft
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
v-rzhou-msft
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.

lkalawski
Memorable Member
Memorable Member

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.