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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
JoshEnglish
Helper I
Helper I

Looking up values from a 2-dimensional table

I have a table that lists quotas by quarter for three teams, where the teams are in each row and the quarters are in columns.

 

I have a query that summarizes sales by team, quarter, and category. The Column headers are Team, Quarter, Category, Amount.

 

I would like to calculate the percentages of each category and quarter against the quota.

 

I cannot find a formula to put into a column that would do this lookup?

 

Is this even possible?

1 ACCEPTED SOLUTION
dramus
Continued Contributor
Continued Contributor

My first thought is that you need to pivot the Team Quotas table. So that you have three columns (Teams, Quarter and Quota). 

 

Then create a summary table of the sales that sums the amount.

Teams Summary = SUMMARIZECOLUMNS('Sales'[Team],'Sales'[Quarter],Sales,"Total Sales",sum(Sales[Amount]))

I then used a lookupvalue() function to find the matching budget for a Team/Quarter and create a column on the new summary table

Budget = lookupvalue('Team Quotas'[Quota],'Team Quotas'[Team],[Team],'Team Quotas'[Quarter],[Quarter])

I can then create a new column for the budget percentage,

Budget Percent = [Total Sales]/[Budget]

I'm sure you could combine some of these steps, but I think this makes it clearer what's going on.

View solution in original post

3 REPLIES 3
dramus
Continued Contributor
Continued Contributor

My first thought is that you need to pivot the Team Quotas table. So that you have three columns (Teams, Quarter and Quota). 

 

Then create a summary table of the sales that sums the amount.

Teams Summary = SUMMARIZECOLUMNS('Sales'[Team],'Sales'[Quarter],Sales,"Total Sales",sum(Sales[Amount]))

I then used a lookupvalue() function to find the matching budget for a Team/Quarter and create a column on the new summary table

Budget = lookupvalue('Team Quotas'[Quota],'Team Quotas'[Team],[Team],'Team Quotas'[Quarter],[Quarter])

I can then create a new column for the budget percentage,

Budget Percent = [Total Sales]/[Budget]

I'm sure you could combine some of these steps, but I think this makes it clearer what's going on.

Thanks. That was the solution. 

JoshEnglish
Helper I
Helper I

I have a table that lists quotas by quarter for three teams, where the teams are in each row and the quarters are in columns.

 

I have a query that summarizes sales by team, quarter, and category. The Column headers are Team, Quarter, Category, Amount.

 

I would like to calculate the percentages of each category and quarter against the quota.

 

I cannot find a formula to put into a column that would do this lookup?

 

Is this even possible?

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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