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

go into "Table" create if Condition, formula help

hello, here is a screenshot.  basically i merged 2 tables based on a matching ID, so for each ID it creates a table of all matching entries...  what I want to do is create a formula for each new Column that looks at the 'Date' column of embedded Table and test if certain conditions are met.  The column headers has the condition.... there is a "Blood Date" in main table i need to refrence as well

 

*see screenshot, ("Date" referes to Date in embedded Table)

column3,  Called NovDec = if Date is < Jan 1 2023 then 1 else 0

column4,  Called Jan = if Date is > Jan 1 2023 AND before Jan 31,2-23 then 1 else 0

column5,  Called Feb before Blood Date = if Month(Date )='Feburary" AND Date <= "Blood Date" then 1 else 0

column6,  Called Feb after Blood Date = if Date > "Blood Date" then 1 else 0

 

im just not sure the syntax to refer to embedded table.  tahnks for any help with these formulas

 

ilcaa722_0-1678741623383.png

 

 

 

1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @ilcaa722 ,

 

Please create 4 custom columns.

Called NovDec:

if List.IsEmpty(List.Select([MD_call_Data][Date],each _ < #date(2023,1,1))) then 0 else 1

//Called Jan = if Date is > Jan 1 2023 AND before Jan 31,2-23 then 1 else 0

There seems to be a slight typo here, and I'm guessing you want this.

Called Jan:

if List.IsEmpty(List.Select([MD_call_Data][Date],each _ >= #date(2023,1,1) and _ <= #date(2023,1,31) )) then 0 else 1

Called Feb before Blood Date:

if List.IsEmpty(List.Select([MD_call_Data][Date],(x)=> Date.MonthName(x) = "Feburary" and x <= [Blood Date])) then 0 else 1

 Called Feb after Blood Date:

if List.IsEmpty(List.Select([MD_call_Data][Date],(x)=> x > [Blood Date])) then 0 else 1

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

1 REPLY 1
v-cgao-msft
Community Support
Community Support

Hi @ilcaa722 ,

 

Please create 4 custom columns.

Called NovDec:

if List.IsEmpty(List.Select([MD_call_Data][Date],each _ < #date(2023,1,1))) then 0 else 1

//Called Jan = if Date is > Jan 1 2023 AND before Jan 31,2-23 then 1 else 0

There seems to be a slight typo here, and I'm guessing you want this.

Called Jan:

if List.IsEmpty(List.Select([MD_call_Data][Date],each _ >= #date(2023,1,1) and _ <= #date(2023,1,31) )) then 0 else 1

Called Feb before Blood Date:

if List.IsEmpty(List.Select([MD_call_Data][Date],(x)=> Date.MonthName(x) = "Feburary" and x <= [Blood Date])) then 0 else 1

 Called Feb after Blood Date:

if List.IsEmpty(List.Select([MD_call_Data][Date],(x)=> x > [Blood Date])) then 0 else 1

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

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
Top Kudoed Authors