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
lottieritchie
Helper I
Helper I

Creating a table that is a pivot over another table

Hi, 

 

I have a table that has a record of rooms within houses (see example below). 

What I am trying to achieve is a table, with the list of properties (appearing only once), and if there is any room within that house that requires an Express Turn Around. 

 

What I would have previously done in excel is create a pivot table over my table, and  filtered on where the Scope = Express Turn Around, and then from my list of properties, lookup to see if that property exists in the pivot table. 

 

How do I achieve the same thing (or get the same result) in power BI? 

 

Thank you!

 

PropertyRoomScope 
123 Test StreetBedroom 1Express Turn Around
123 Test Street Bedroom 2Standard Turn Around
345 Test Street Bedroom 1Express Turn Around 
4 REPLIES 4
v-yalanwu-msft
Community Support
Community Support

Hi @lottieritchie ,


You could create a new table by the following formula:

newtable =
var _table=SELECTCOLUMNS('Table2',"1",[Property])
return FILTER('Table1',[Property] in _table&&[Scope]="Express Turn Around")

The final output is shown below:

v-yalanwu-msft_1-1620381861174.png

If it's not right, please share with me your expected result.
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

negi007
Community Champion
Community Champion

@lottieritchie Hi will it be possible for you to share your powerbi sample file or more detailed information about your base data and output data. this will help us to provide you a solution. Thanks




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



Proud to be a Super User!


Follow me on linkedin

Hi @negi007  thanks for your reply. 

 

I've got some personal data in my full data set so I've pulled out just the relevant table as a hopefully clearer explanation of what I am trying to achieve. 

 

You'll see there is a table called 'Scope'. At the moment I have, for example, if you look at the column 'Property', and for example look at 15 The Park, you will see that 3 of the 5 rooms have the status 'Express Turn Around' in the column 'Turn Around'. 

 

What I would like to get to is a table with each Property only listed once, and if any of the rooms for that property say 'Express Turn Around' then the Turn Around status for the whole property line item would be Turn Around.

 

I've created this in Excel to show my desired outcome / how I would have done this in excel! 

 

Thanks for your help 

 

@negi007 Sorry just trying to work out how to upload a file on here, I can't see that I can? 

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.