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

One-to-Many Relationship; Matrix Layout

Hello,

 

I have a report I am trying to consolidate. This report involves gathering data on a transactional basis, summing it, and comparing it to a budget.

 

For example, I have 3 employees who have made the following purchases shown below in a table:

 

NameTransaction Amount
John Appleseed$50
John Appleseed$125
John Appleseed$60
John Appleseed$70
David Smith$558
David Smith$143
David Smith$369
Bill Gates$258
Bill Gates$749
Bill Gates$319
Bill Gates$178
Bill Gates$2,589
Bill Gates$14,563
Bill Gates$1,485,857

 

I also have the budgets for these employees in another table:

 

NameBudget
John Appleseed$1,000
David Smith$2,000
Bill Gates$2,000,000

 

What I am wanting to do is have Power BI summarize the transactions and then display the budget next each employee with a budget remaining column. All of this done in a matrix and viewed like this:

 

NameTotal TransactionsBudgetBudget Remaining
John Appleseed$305$1,000$695
David Smith$1,070$2,000$930
Bill Gates$1,504,513$2,000,000$495,487

 

Any help would be appreciated.

 

Thank you

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @jwfite37 ,

 

You need to create a relationship between both tables, and then create the following measure:

 

Budget Remaining = SUM(Budget[Budget])-SUM(Purchases[Transaction Amount])

Now create your matrix accordingly to the following:

  • Rows: Name (Budget Table)
  • Values:
    • Budget (Budget Table)
    • Transaction Amount (Transaction Table)
    • Budget remaining (Measure created previously)

 

Check the result in the PBIX file attach (August version).

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
jwfite37
Frequent Visitor

To anyone else who finds this post, @MFelix helped me out over at this post.

MFelix
Super User
Super User

Hi @jwfite37 ,

 

You need to create a relationship between both tables, and then create the following measure:

 

Budget Remaining = SUM(Budget[Budget])-SUM(Purchases[Transaction Amount])

Now create your matrix accordingly to the following:

  • Rows: Name (Budget Table)
  • Values:
    • Budget (Budget Table)
    • Transaction Amount (Transaction Table)
    • Budget remaining (Measure created previously)

 

Check the result in the PBIX file attach (August version).

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi @MFelix ! Thank you very much for this solution, and it has worked just as you stated.

 

However I am expierencing a new issue that I should have disclosed initially. I have added dates to the transaction table, and this is how Power BI looks when added.

 

 January  February  March  Total  
 Transaction AmountBudgetRemaining BudgetTransaction AmountBudgetRemaining BudgetTransaction AmountBudgetRemaining BudgetTransaction AmountBudgetRemaining Budget
John Appleseed17510008256010009407010009303051000695
David Smith55820001442143200018573692000163110702000930
Bill Gates1007200000019989933086200000019969141500420200000049958015045132000000

495487

 

I would prefer that the Budget and Remaining Budget be removed from the monthly sets and to only show the budget and remaining budget columns at the end, as pictured below:

 

 JanuaryFebruaryMarchTotal  
 Transaction AmountTransaction AmountTransaction AmountTransaction AmountBudgetRemaining Budget
John Appleseed17560703051000695
David Smith55814336910702000930
Bill Gates10073086150042015045132000000495487

 

Is this possible in a Power BI matrix?

 

Thank you for your help.

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.