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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
anwilkins
Resolver II
Resolver II

Apply a label when two conditions exist in one record

I need to create a measure or a calculated column that looks at each row and if condition 1 is present, the result is "Present". If condition 2 exist, the result is "Missing". If Both Conditions occure in the SAME visit, I want the result to be "Present".

 

Scenerio

Patient A has  A1C checked = Present

Patient B has BMI checked = Missing

Patient C has BMI checked AND A1C checked in the same visit = Present

Picture one is an example of the current display / Picture 2 is the desired display. Note that I go from 12 lines to 7 lines

anwilkins_0-1666793735784.pnganwilkins_1-1666793777329.png

 

Sample data if needed

NAMELAST APPT DATEA1C TEST
Ashley9/18/2022Present
Ashley9/18/2022Missing
Michael10/12/2022Present
Michael8/12/2022Present
Donna7/28/2022Present
Julie9/24/2022Missing
Julie9/25/2022Missing
Danny9/18/2022Present
Marco10/1/2022Missing
Marco10/1/2022Missing
Marco10/1/2022Present
Marco10/1/2022Missing
1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @anwilkins 

Here are the steps you can refer to :

(1)My test data is the same as yours.

(2)We need to click "New Column" to create a calculated column :

Falg = IF( 'Table'[A1C TEST] = "Present" ,1,0)

(3)We nned to click "New Measure" to create a measure :

Result = IF( SUM('Table'[Falg]) >0 , "Present" ,"Missing")

(4)Then we put the filed we need and the measure on the visual , we will meet your need , the result is as follows:

vyueyunzhmsft_0-1666836395242.png

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
v-yueyunzh-msft
Community Support
Community Support

Hi , @anwilkins 

Here are the steps you can refer to :

(1)My test data is the same as yours.

(2)We need to click "New Column" to create a calculated column :

Falg = IF( 'Table'[A1C TEST] = "Present" ,1,0)

(3)We nned to click "New Measure" to create a measure :

Result = IF( SUM('Table'[Falg]) >0 , "Present" ,"Missing")

(4)Then we put the filed we need and the measure on the visual , we will meet your need , the result is as follows:

vyueyunzhmsft_0-1666836395242.png

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Thank you so much! 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.