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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
stefanhamann
Regular Visitor

Prevent many to many connection after unpivot

Dear all, 

I'm trying to find a way through but I'm quiet stuck right now. 

2020-04-18 00_43_36-2020-Power BI Desktop.png

 

 

 

 

 

 

 

 

 

I have a table with budget per month.

  • Each row has an unique buget ID f.e. AS_20_001
  • and 12 columns, one for each month by date f.e. 01.07.2020 (always the first of the month) 
  • the date columns provide the budget for the month

To get the data structured I used the unpivot function for the month columns, so I can now calculate numbers on my budget

 

The second table is the requisition table which provides the order in the fysical year. 

  • there can be multiple orders to the same budget ID
  • also there can be orders without a budget ID 

 

I want to calculate sum(Budget[Budget] - sum(Requisition[]budget]) - by the budget ID to get the overview about when was my budget used and how many is left to date. 

 

Problem is that with the unpivot function the budget ID is not unique anymore and the connection is many-to-many. I tried to put a bridge table in between but it does not work either (for my knowledge) 

 

Can someone give me a hint? Is there a function available which i missed? All help is really appreciated.  

Thank you and have a wonderfull weekend. 

1 ACCEPTED SOLUTION

After a while of additional research and tesing I was able to fix it. 

 

I added a few columns in my bridge table and filtered by the uniqe ID to sum up the values. 

f.e. Budget = CALCULATE(SUM(Budget[Budget]);FILTER(Budget;Budget[Req Tracking Nr]='Requsition Items'[Req Tracking Nr]))

View solution in original post

3 REPLIES 3
VijayP
Super User
Super User

Can you  share the pbix to see the structure of the data




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Thank you for the opportunity. Additionally I want to say the budget file is a handmade structure which could be changed. The other sources are reports which cannot be changed. 

 

https://www.dropbox.com/s/yrii72uz8fxk4i9/Forum-Reducing-Data.pbix?dl=0 

After a while of additional research and tesing I was able to fix it. 

 

I added a few columns in my bridge table and filtered by the uniqe ID to sum up the values. 

f.e. Budget = CALCULATE(SUM(Budget[Budget]);FILTER(Budget;Budget[Req Tracking Nr]='Requsition Items'[Req Tracking Nr]))

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.