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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
sramamoorthy23
Frequent Visitor

Excel Power Pivot conditional bridging of two tables

I have a student Brekky Roster (sqlserver view) with dates of roster and a Student availability sqlserver table with Absence status. I need to create an Student availability matrix for a month in Pivot table.   The screenshots of table and the final view to be displayed in pivot is as below:

Problem: Student id in the both the tables are matching however some of the dates are matching. I have tried to create relationship between tables through a calendar table in power pivot and a bridging table as these two tables have many to many relationship. Created a measure to diaplay the availability status in values field of pivot using Concatenatex function. However, I am not able to drag the measure to final pivot values field. Can you please help on this?

 

 

Excel tables created through Power QueryExcel tables created through Power QueryFinal Student Availability MatrixFinal Student Availability Matrix 

4 REPLIES 4
sramamoorthy23
Frequent Visitor

Any Clue?

BA_Pete
Super User
Super User

Hi @sramamoorthy23 ,

 

Create a new column on each of your original tables in Power Query called [studentDate]:

Text.Combine({[StudentId], [Date]}, "-")

 

You should now be able to merge the two tables together on TableA[studentDate] = TableB[studentDate].

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Thanks @BA_Pete  For your quick response.

Please note that columns in the both tables are different. I need to display the Student availability irrespective of the job selected in the report filter. Based on the student id the availability from Student absense table must be filled in the value area of pivot table. If I merge table as Left outer join then I will get null values for job and  Leadership role in StudentBrekyRoster table. However, When I select the job number from the report filter in pivot I won't get the desired output.  I hope its clear. If not please let me know I will send you the screenshots. I am stuck at this solution.

 

 

Sorry, I'm struggling to understand what you're going for here.

Implementing my solution will give you a dataset capable of providing the output that showed in your original post.

You may need to adjust the front-end to display exactly how you want it to, but the Power Query solution has been provided.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors