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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
JLambs20
Helper III
Helper III

Create Conditional Format in Power Query

Hello!

 

I'm looking to create a conditional column that is based on a different column within a range of cells.  

 

If the "Status" column contains the word "Finalized" for any of the cells in a range that all have the same value in a separate column (Number), then return "Finalized", if not "Current".  

 

Here is an example of what I mean

 

JLambs20_0-1674497942990.png

 

So, for Number 123456, there is one cell in the "Status" column that says "Finalized".  Since that's the case, the new column would say "Finalized" for each of those cells in the row with the same Number.  If the Status column doesn't say "Finalized", then it would say "Current". 

 

Thank you!

3 REPLIES 3
olgad
Super User
Super User

Hi, 

in Power query go to transform-group by

under group by click grouping by number and in the summarized columns pick by max Status (or if you wanna go carefully about then create a conditional before, if finalized then 2 if current then 1) and max by that column plus pick the option All name it All and afterwards expand All with all the columns except for the Number column.


DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime
marcelsmaglhaes
Super User
Super User

Hey @JLambs20 !

 

I dont' know if that is the best alternative, but you can solve the problem duplicating the table. In this duplicate table (Table 2), you can filter Status = Finalized and if there more one stage for the same number Finalized, you can group the table. You just need one distinct number and one finalized status.

After that you can Merge Table and Table 2 in a New Query by the Number column. After the merge process, you expand the Status from the table 2. And you will got the Finalized value for all rows that you need. The null value in Status column you should change to 'Current.'

 

Makes sense?

 

 

marcelsmaglhaes_0-1674502074927.png

 

Duplicated table wiht Status = Finalized

marcelsmaglhaes_1-1674502105920.png

 

Merged table with the null value replaced to Current and all 12345 rows with Finalized

marcelsmaglhaes_2-1674502135655.png

 

 

 

 


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!



I didn't end up using this solution but I appreciate the insight! I'll keep this in mind next time I run into a similar issue. 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors