Skip to main content

The Power of IF in POWER BI

If Then, Power BI

DEMO BELOW

The power of "what if" has been debated, discussed, deployed, and dreamed about for centuries. It's woven into the fabric of human nature and technology is a product of its power. 

Does the IF function have a lot of power in Power BI? Sure.  But where does the power of IF have more power than in the house or in the classroom. 



Mr. Peterson, IF I do the extra credit this weekend how much will my grade go up?

Mr. Peterson, IF I don’t have any more missing homework assignments for the rest of the quarter will my grade improve?

Mr. Peterson, IF we learn all this Algebra you are teaching how will it help me in the real world?

"Dad, IF I don’t miss any more chores this week can I pick where we go out to eat tonight”
My response, "IF you don’t miss any more chores, THEN you get to pick where we eat Saturday, ELSE mom and I get to pick where we eat."

You see IF statements not only get the brain exploring endless possibilities, but they generate a logical flow of thinking throughout a scenario.

That’s exactly how the IF statement works in Power BI.  Well, that seems easy, right?  But what IF (see what I did there 😉) there are more than just two outcomes.  What IF (I did it again 😉) there is a tiered level of response to Jack missing chores.  If he doesn’t miss any, then he gets to pick where we eat, but if he misses 1 or 2 then we flip a coin between his choice and Mollie and my choice, but if he misses over 3 then we get the pick of the restaurant.  This is where nested IF statements will come into play.

The demos I have set up for this explanation of IF statements will revolve around a real-world classroom scenario that I experienced while teaching and another scenario that I see coming up concerning children’s screen time down the road.  Enjoy! ðŸ˜Š

Click here to access this demo. 


Comments

Popular posts from this blog

Best Practice To Trim Before Removing Duplicates or Merging In Power Query Editor

In last week’s blog, I wrote and did a video about how to remove duplicate records and keep the most recent entry as long as a date column was part of the data source.   I came across the scenario while giving training on Power BI with my company Pragmatic Works.   See the video below:     This week, while doing another two-day training I came across a different scenario from a follow-up conversation from day 1.   I had explained how to remove duplicate records and one of the students started working on a Power BI project she has for her company.   On day 2 the student informed me that her remove duplicates step was not working.   I said that is odd and I asked to see the data.   In one of her table visuals, I could see that it appeared that a few of the records had duplicates based on the name column.   After further investigation though, we figured out the culprit.     She had done all the steps correctly, but it was a data integrity issue.   In her data source, the perso

The Power of CALCULATE in Power BI

Last week in my blog and video I discussed how Power BI could have made my life as a teacher much easier.  It is not that Power BI can do things that I could not on my own.  It is the fact that Power BI could have saved me so much time.   This led me to some thoughts and questions.   How could I have impacted the students more in the classroom with this extra time?  Would teachers who were not analyzing student data due to time constraints now start?  How can I make the data tell my students a story that gives them an accurate picture of their progress?   That last question is what leads to this week’s blog.   Many times the metrics (which is just a fancy word for "numbers") of what we want to show are easy to do by hand with a basic math background.  Although easy, it can be very time consuming when dealing with different groups of data: like 6 periods of students instead of 1 period. When we want to do these calculations quickly with minimal effort in Power BI it is not

Relating "Related Tables" to Baseball because I Miss Sports

I miss sports. In particular, I miss baseball. Between learning more Power BI functions and the ins-and-outs of DAX, I've turned to Netflix to fill the deep caverns left in my soul since baseball season has been postponed. And as a result, I've thought more about tigers and big cats more than I ever have in my life. I know ALL about Carol Baskins and am fully on board for a spin-off centering on locating her lost husband. I've googled "is it really legal to own a tiger in a residential area?" Without baseball in April, I am barely hanging in there (kinda like Joe Exotic's eyebrow ring). So, I am filling the sports-sized hole by using baseball stats in Power BI to demonstrate pulling data from multiple tables and consolidating it into one table.  Some of the data we want to consolidate also has to have some aggregations (which is fancy for "calculations") performed on it.  In this demo I will attempt to break down what is really going on