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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
JohnJoe123
Helper II
Helper II

Power Query - How to Replace null Values in a Column based on 2 Conditions from other Columns?

Hi Everyone,

 

Below is a Link to my Power BI File.

https://drive.google.com/file/d/1SCOPpMWBnMiK5vl6OnzNsHBl6Mt2Tupy/view?usp=drive_link

 

I've entered the Data Manually into the File.

But I've also pasted an image of my table below to illustrate what I'm trying to achieve.

(And I've also placed a Red Box around the Row that I'm interested in - I'll explain more below)

JohnJoe123_0-1705057552738.png

 

In the MTBF Column - you'll notice that there are several null Cells.

 

In Power Query, I'm trying to replace the null values in the MTBF Column

with the corresponding Row Value in the RUN TIME column,

only if the following 2 Conditions are met:

1. The RUN TIME > 0

2. The COUNT = 0

 

Otherwise, I'd like all other values in the MTBF Column to remain as they are.

 

Based on this, the only MTBF Value that would change if everything works correctly, is that in Row 3. (Red Box)
The null value in the MTBF Column on Row 3 would change to 450.

 

How do I do this?

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

2 REPLIES 2
hvnter
Resolver I
Resolver I

If you have the ability to do this on your datasource side (i.e. SQL Server) you should handle the CASE statement for it there

Ahmedx
Super User
Super User

pls try this

Screenshot_1.png

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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