cancel
Showing results for
Did you mean:
Frequent Visitor

## Adding a value to 2 rows based on 1 row

So, i have a table like this which has the energy consumption reading for different energy type.

When there is a shutdown in the plant, the gas reading drops immediately, so whenever the gas reading is below 3, it indicates that there was a shutdown.

What i want to do is calculate the energy consumption when the machine was running, which means i have to subtract the Gas, Steam and Electricity reading during the shutdown from the total energy consumption of the day.

So, i want the SD value to be 1 for both steam and electricity at all the Date and Time instances when Gas is below 3 or SD is 1. And since i am new to PowerBI, i really dont have much idea on what to do to be honest.

I hope the question is clear, and any help would be really really be helpful for me.

1 ACCEPTED SOLUTION
Super User

Hi @Viswajth_Nair95
Please refer to sample file with the solution https://www.dropbox.com/t/87UNh6OAhZDbijhM

``````SD =
IF (
CALCULATE (
SELECTEDVALUE ( EnergyConsumption[Energy] ),
EnergyConsumption[EnergyType] = "Gas",
ALLEXCEPT ( EnergyConsumption, EnergyConsumption[Date], EnergyConsumption[Time] )
)
< 3,
1
)``````
2 REPLIES 2
Frequent Visitor

That worked like a charm, thank you so much for that

Super User

Hi @Viswajth_Nair95
Please refer to sample file with the solution https://www.dropbox.com/t/87UNh6OAhZDbijhM

``````SD =
IF (
CALCULATE (
SELECTEDVALUE ( EnergyConsumption[Energy] ),
EnergyConsumption[EnergyType] = "Gas",
ALLEXCEPT ( EnergyConsumption, EnergyConsumption[Date], EnergyConsumption[Time] )
)
< 3,
1
)``````

Announcements

#### 2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

#### Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

#### 2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors