Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have three tables, example:
Table 1 shows the normal weekly quantity allowed on for a particular origin-destination combination. e.g., UK to DE normally we are only allowed to send 8 units.
Table 2 shows that for some weeks we might have an exception. Example IE to BE for weeks 52 and 01 (christmas holidays!) we are not allowed to send any units (ZERO units). Table 2 ONLY shows exception weeks - not all weeks.
Table 3 shows the week range of the total data set. i.e. ALL weeks
Previously I was just multiplying the QTY by the number of weeks to get a total, but the new exceptions (table 2) means that I can't do that any more. It is also important that I am able to show this by week as well as by total, as it goes into a lvely line chart over time. So I am looking for a way to join these tables together to give me something like this, where all data in table 1 is shown against all weeks:
(which is horrible proliferation, I know, but my actual Table 1 is only 2K rows so if I proliferate even for a full year of 52 weeks it's still not that bad!)
Solved! Go to Solution.
Hi @dapperscavenger ,
I would start with table3 and add a custom column where you reference table1.
That will return everything from table1 for each week.
Then join table2 to it based on "From", "To", and "week".
Then add a custom column with the condition that if the value of the expansion from table2 is null, then take the expansion from table1, else take expansion from table2.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @dapperscavenger ,
I would start with table3 and add a custom column where you reference table1.
That will return everything from table1 for each week.
Then join table2 to it based on "From", "To", and "week".
Then add a custom column with the condition that if the value of the expansion from table2 is null, then take the expansion from table1, else take expansion from table2.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Brilliant, yes, it was just that first step I was stuck on. I didn't know you could reference another column like that
Had to look up how to write it but it was fairly straightforward: =#"table_name_here"
Thank you
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
17 | |
10 | |
8 | |
8 | |
7 |