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
Viswajth_Nair95
Frequent Visitor

Adding a value to 2 rows based on 1 row

Viswajth_Nair95_0-1658211784115.png

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. 

 

Thanks in advance!

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

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

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

View solution in original post

2 REPLIES 2
Viswajth_Nair95
Frequent Visitor

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

tamerj1
Super User
Super User

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

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

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.

Top Solution Authors