cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Oluomo1
Frequent Visitor

Power up challenge - What is wrong with the Fx formular

I want to populate "Current Location" with Values from "Foster Claimer", and if "Foster Claimer" is blank, it should pick value from "Initial Location". What is wrong with my fx formular below

 

fx= IF(IsBlank('Foster Claimer'),'Initial Location', 'Foster Claimer')

1 ACCEPTED SOLUTION

Accepted Solutions
jdmoze2
New Member

Hi @Oluomo1 , I was able to get mine to work by using this formula:

If(IsBlank('Date of foster'), 'Initial Shelter'.'Shelter ID', If(IsBlank('Date of Adoption'), 'Foster Claimer'.'FosterID', 'Adopter'))

Basically, it's saying that if the animal's "Date of foster" column is blank within the current table, it means the animal is still being sheltered within the "Initial Shelter".  Therefore, we want to populate the current table's "Current Location" column with the "Shelter ID" tied to the "Initial Shelter".  To achieve that, we need to understand that the current table's "Initial Shelter" column is a Lookup column that maps to another table's column titled "Shelter ID".  If the initial assessment is true -- meaning the "Date of foster" column is blank, then we should observe the population of the Initial Shelter's Shelter ID through this Lookup.
 
However, if the "Date of foster" column within the current table is not blank, our formula progresses to the "else" logic.  In this case, this next assessment is another "If" operation.  As you can probably now better understand, this second "If" assessment determines if the current table's "Date of Adoption" column is blank.  If it is, we now know that the animal is currently being fostered.  As such, we go through an identical Lookup as previously described for the first "If" statement.  But in this case, the Lookup is being performed through the current table's "Foster Claimer" Lookup column that can then retrieve the value from another table's corresponding "FosterID" column.
 
However, if both of the previous "If" assessments were not true, we enter the final "else" condition in which we realize the animal must be adopted because the "Date of foster" and "Date of Adoption" columns within the current table have both been populated.  As such, our "else" statement returns results from the current table's value captured in the "Adopter" column.
 
And then we reach the end...  We simply type in "))" twice to close the formula.  We then click "Save" and return to the table to verify success or failure by observing if data was automatically populated into our "Current Location" column.
 
I truly hope this helps!  Please don't hesitate to reply if it doesn't.  Super happy to help you troubleshoot further.
 
Wishing you all the best!
 
Justin
 
P.S.  If this works for you, you'll note that some of the "Current Location" entries are still blank.  That's because the Excel file we were given has several blank fields for "Adopter" even though the animal had been listed as "Adopted" and also had a date of adoption inserted within the "Date of Adoption" column.  But this shouldn't take away from the functionality of the formula and its use for future animal sheltering/fostering/adoption entries once you build the apps in subsequent portions of the challenge.

View solution in original post

4 REPLIES 4
BCBuizer
Multi Super User
Multi Super User

Hi @Oluomo1 ,

 

Power Fx is case sensitive, meaning you need to be very precise when it comes to capitals. In this case the second character of the IF function should be a lower case:

If(IsBlank('Foster Claimer'),'Initial Location', 'Foster Claimer')

 

An extra tip: especially for this scenario where you need to have the first non blank value from two references, you can use the Coalesce function:

 

Coalesce('Foster Claimer', 'Initial Location')


Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

@BCBuizer, thanks for your response, the "coalesce" is not even coming up at all. Please look at the formular in the screen shot attached to see if you know what I have done wrong

BCBuizer
Multi Super User
Multi Super User

Hi  @Oluomo1 ,

 

From the screenshot you are sharing it has become clear you are using the formula for a Formula column in Dataverse. Since that is still a preview feature at this point, not all functions are available: Work with Dataverse formula columns - Power Apps | Microsoft Learn. Had you try to use this in a canvas app, it would have worked.

 

The error you receive is probably caused because either or both of the referenced columns are LookUp columns. For those, you have to select a column within the returned record that contains a text or number, for instance:

If(IsBlank('Foster Claimer'),'Initial Location'.LocationName, 'Foster Claimer'.ClaimerName)

 

In the above example you probably need to change the LocationName and ClaimerName identifiers with the actual names of the columns you have and want to use.

 



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.
jdmoze2
New Member

Hi @Oluomo1 , I was able to get mine to work by using this formula:

If(IsBlank('Date of foster'), 'Initial Shelter'.'Shelter ID', If(IsBlank('Date of Adoption'), 'Foster Claimer'.'FosterID', 'Adopter'))

Basically, it's saying that if the animal's "Date of foster" column is blank within the current table, it means the animal is still being sheltered within the "Initial Shelter".  Therefore, we want to populate the current table's "Current Location" column with the "Shelter ID" tied to the "Initial Shelter".  To achieve that, we need to understand that the current table's "Initial Shelter" column is a Lookup column that maps to another table's column titled "Shelter ID".  If the initial assessment is true -- meaning the "Date of foster" column is blank, then we should observe the population of the Initial Shelter's Shelter ID through this Lookup.
 
However, if the "Date of foster" column within the current table is not blank, our formula progresses to the "else" logic.  In this case, this next assessment is another "If" operation.  As you can probably now better understand, this second "If" assessment determines if the current table's "Date of Adoption" column is blank.  If it is, we now know that the animal is currently being fostered.  As such, we go through an identical Lookup as previously described for the first "If" statement.  But in this case, the Lookup is being performed through the current table's "Foster Claimer" Lookup column that can then retrieve the value from another table's corresponding "FosterID" column.
 
However, if both of the previous "If" assessments were not true, we enter the final "else" condition in which we realize the animal must be adopted because the "Date of foster" and "Date of Adoption" columns within the current table have both been populated.  As such, our "else" statement returns results from the current table's value captured in the "Adopter" column.
 
And then we reach the end...  We simply type in "))" twice to close the formula.  We then click "Save" and return to the table to verify success or failure by observing if data was automatically populated into our "Current Location" column.
 
I truly hope this helps!  Please don't hesitate to reply if it doesn't.  Super happy to help you troubleshoot further.
 
Wishing you all the best!
 
Justin
 
P.S.  If this works for you, you'll note that some of the "Current Location" entries are still blank.  That's because the Excel file we were given has several blank fields for "Adopter" even though the animal had been listed as "Adopted" and also had a date of adoption inserted within the "Date of Adoption" column.  But this shouldn't take away from the functionality of the formula and its use for future animal sheltering/fostering/adoption entries once you build the apps in subsequent portions of the challenge.

Helpful resources

Announcements

Important Update | Power Up Community READ ONLY July 22 – July 28

Dear Community Members, As you may have read, the Power Platform communities are transitioning to a new platform and to access will be set to READ-ONLY mode during the transition. Key DatesTo ensure current learners have adequate support in the final week of the cohort, the Power Up Program Community will transition to READ-ONLY mode starting July 22nd, the platform will transition to READ-ONLY mode until July 28th. Power Apps, Power Automate, and Power Pages communities will be read-only July 16-22, 2024.During this period, members will not be able to start new threads or Kudo, Comment, or Reply to any posts, but will be able to search and review past threads or solutions. On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities. Learners will be able to sign in to the new Power Up Program community experience, starting July 29th. If you registered for community using your learnwithpowerup account, you will not receive an email, but should be able to sign in successfully if you are signed in to My hub.  If you need help with your community account, please submit a request at aka.ms/PPCommSupport We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead! 

Learn what to expect in the Power Up Program

Since its inception in 2022, the Power Up Program has evolved based on feedback from learners and Microsoft Partners and customers. Today's Power Up learners can expect to learn the fundamentals of Microsoft Power Platform in the accelerated seven-week, video-based Power Up Maker course.   Hear from Principal Program Manager, Dimpi Gandhi to discover the latest enhancements and meet the Microsoft MVPs, Rory Neary and Charlie Phipps, who partnered with the Microsoft Power Up Program to create the Power Up Maker course to guide learners to use the Microsoft Power Platform to develop custom applications, build dazzling report dashboards, or create efficiencies through automation.  

Welcome to the Power Up Program Community

The Power Up Program is a free upskilling program where nontechnical people can learn the fundamentals of Microsoft Power Platform. The Power Up Maker course is a seven-week self-paced virtual learning plan that include video-based objectives featuring Power Apps, Power BI and Power Automate.  As a member of the Power Up Community, you can grow your skills and build connections. You can post questions to get help with the curriculum and hands-on exercises from experts and peers in the product boards.  Check out the Community Information & Feedback board to find help or provide feedback with the community experience, and please take time to post in the Social board to tell us more about yourself. If you're new to the Power Up Program and looking for information to register. You can sign up at PowerUp.Microsoft.com.

Users online (458)