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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JustinRobinette
New Member

Conditional Column if Identifier ever has a value in specific column

I have a table with multiple rows for each identifier. I want to add a conditional column if the identifier ever has a specific value in another column. In the below example, because FIN 234 contains Observation on one row, I want all rows of that FIN to include 'Observation'.

 

FIN          Census Event          Encounter Type          Proposed New Column
123          Admission                Emergency

123          Discharge                 Emergency

234          Admission                Emergency                        Observation

234          Transfer In                Observation                      Observation

234          Discharge                 Observation                      Observation

345          Admission                OP Surgery

345          Discharge                 OP Surgery

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=if(CALCULATE(COUNTROWS(Data),FILTER(Data,Data[FIN]=EARLIER(Data[FIN])&&Data[Encounter Type]="Observation"))>0,"Observation",Blank())

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

1 REPLY 1
Ashish_Mathur
Super User
Super User

Hi,

This calculated column formula works

=if(CALCULATE(COUNTROWS(Data),FILTER(Data,Data[FIN]=EARLIER(Data[FIN])&&Data[Encounter Type]="Observation"))>0,"Observation",Blank())

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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