cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

calculating a measure based on a column in a different table

Question

 

The following measure successfully calculates the cumulative CO2 emissions per building present in my data model, based on electricity and gas usage of each building. The buildings are in a different table than the measure, and so are their square meters of floor area.

 

Cumulative CO2 Emissions Year per Building = 
 IF(
 MONTH([Date ]) < MONTH(TODAY());
 ElectricityTelemetryData[Cumulative CO2 Emission Electricity Year]+GasTelemetryData[Cumulative CO2 Emissions Gas Year];
 BLANK()
    )

 

Now I want to divide this measure by the square meters that belong to each building. Strangely enough, the following DAX code doesn't work, and it gives the message "The column 'Buildings[HouseSizeInSquareMeters]' either doesn't exist or doesn't have a relationship to any table available in the current context." Even though the tables ARE related, albeit indirectly, and I have already tried switching cross-filter directions of relationships from single to both.

 

Cumulative CO2 Emissions Year Per Building per m² = 
DIVIDE(
	'MetaUtilityTypes'[Cumulative CO2 Emissions Year Per Building];
	RELATED(Buildings[HouseSizeInSquareMeters])
)

Hope somebody can help!

 

 

 

Kind regards,

 

Robin

Helpful resources

Announcements
Meet the 2020 Season 2 Power BI Super Users!

Meet the 2020 Season 2 Power BI Super Users!

Find out who's part of the program this season, and welcome the new Super Users.

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Featured Data Story of The Month

Featured Data Story of The Month

All Data Stories Gallery contributions are reviewed for each month. We select a contribution and feature the community member the following month.

Power BI Dev Camp - Developing with .NET Core

Power BI Dev Camp - Developing with .NET Core

Learn how to develop custom web applications for Power BI using .NET Core 3.1 and .NET 5.

Top Solution Authors
Top Kudoed Authors