Forum Discussion

Obiweka's avatar
Obiweka
Regular Visitor
3 years ago
Solved

Creating a measure calculation using the IF or Switch and True function

Please I would like some help to write a Measure in Power Bi using IF or Switch function to calculate carbon emission (carbon emission= Total weight x emission factor) based on data contained in two ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Obiweka ,

    You can create a calculated column as below in Table1 to get it:

    Column =
    VAR _efactor =
        CALCULATE (
            MAX ( 'Table2'[Emission Factor] ),
            FILTER (
                'Table2',
                'Table2'[Waste Types] = [Waste Description]
                    && 'Table2'[Disposal Facility] = [Disposal Facility Type]
            )
        )
    RETURN
        [Total Weight (Tonnes)] * _efactor

    Best Regards