skip to Main Content

power pivot to power bi

A Power BI Technique Mined from the Power Pivot Archives

Below, you will find one of our all-time favorite Power BI techniques. In the ten (yes ten) years we’ve been operating this site, we’ve written over 1,000 articles on Power BI.  Hard to imagine - even for us - but true.

Years ago, we first wrote up this technique in the context of Power Pivot – Power BI’s cousin and predecessor, which we like to call “Power BI in Excel.” 

Since the two products share the same brains (DAX and M), this technique is more relevant today than ever. Everything below is 100% legit for Power BI – the same data model “shape,” the same DAX, etc. – but now you can use it to power up your Power BI visuals, and not just PivotTables.  Enjoy! Smile

The Problem

We had presented you with the real world exercise, which you could solve using Power Pivot and Power Query. Click to read that blog post or watch the video below introducing the exercise. We highly recommend, you take a crack at solving this yourself before going on to review our solution.
Click to Download Exercise File

The Solution

Click to Download Solution File
You can watch the video below which explains the solution or read on…

Step 1A: Get Your Tables Into Power Pivot

Power Pivot is the central engine in Power BI. As an engine, it uses your data as a fuel. The first thing we will do is to feed the beast.

For the Judges, Contestants, Rounds excel tables simply click the “Create Linked Table/Add to Data Model” button (Excel 2010/2013) to send these to Power Pivot. The round score tables are a little tricky and covered in the next step.

Step 1B: Send Round Scores to Power Pivot via Power Query

Power Query is a terrific tool to clean, shape and transform your data before sending it to Power Pivot. We will use Power Query to combine the score sheets by different judges and also to unpivot columns into rows.

Using Power Query to combine our Judges Scores into a single table

Step 2: Create Relationships in Power Pivot

This data set is fairly clean allowing us to easily connect our data (Score) and lookup tables (Judge, Round, Contestants).

Data and Lookup tables connected via relationships

Step 3: Define DAX Measures

Here are all the measures we defined


RoundWeightage:=IF(HASONEVALUE(Round[RoundScore]), MAX(Round[Weightage]), BLANK())

    , [RoundWeightage]* [ScoreTotal] )

    , BLANK()
    ,RANKX(ALLSELECTED(Contestant), [ScoreWeighted])

Here is a quick description of each:
– ScoreTotal: Thanks to the Power Query shaping this is a simple sum
– RoundWeightage: Simple returns the weightage for a selected Round
– ScoreWeighted: Uses SUMX to iterate through each round and calculated the weighted score (weightage x round score)
– Rank: Uses RANKX with ALLSELECTED to rank our contestants based on [ScoreWeighted]

Step 4: Build the Pivot Table

All the hard work is done. Now you can simply drag-and-drop columns and measures onto your Excel pivots to build the desired solution:

Hope you enjoyed this exercise. I certainly enjoyed working at the beauty pageant and leveraging Power BI to make it run smoother. Kudos to Ashish and Menaka for putting together a terrific show. Learn more at

Click to Download Solution File

Avi Singh

Avi Singh has personally experienced the transformation and empowerment that Power BI can bring - going from an Excel user to building large scale Power BI solutions. His mission now is to share the knowledge about Power Pivot and Power BI.

This Post Has 3 Comments
  1. Thanks again Avi, this was a fun exercise and it was enlightening to see the variety and depth of the approaches used to solve even a simpler problem. Hope you can do this again, between this and the Dax puzzles at I’m getting plenty of practice outside our company walls.

Leave a Comment or Question