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
Grace1
Helper II
Helper II

How to obtain class description

Hi

 

I am new to Power BI.  I like to obtain Class Description in Sales Table from Booking Class using Carrier and Class as relationship.

Appreciate advice. Thanks.

 

Sales Table           
Inv. No.Inv. DateClassCarrierTotal  Air FareTaxesService  Hotel & VisaCanx & Total Class 
    Ticket   Fee Package  Others Sales Description
             
123 03/01/18Y/ESQ12,563.00250.4060.00   2,873.40Econ/Econ
124 04/01/18QTG1352.00101.8030.00   483.80Economy
125 05/01/18DBA17,477.00997.9060.00   8,534.90Business
126 05/01/18QTG1352.00101.9030.00   483.90Economy
127 23/01/18DNH12,320.0059.2060.00   2,439.20Business
128 23/01/18DNH11,740.0059.2050.00   1,849.20Business
129 23/01/18DNH12,320.0059.2060.00   2,439.20Business
130 24/01/18Y/ESQ11,545.00146.8050.00   1,741.80Econ/Econ
131 24/01/18E/YSQ11,545.00146.8050.00  10.001,751.80Econ/Econ
132 29/01/18ESQ1672.0048.8040.00   760.80Economy
133 07/02/18QTG1332.00102.0030.00   464.00Economy
134 14/02/18H/KKE1525.00347.2040.00   912.20Econ/Econ
135 14/02/18J/ESQ12,819.0066.0080.00   2,965.00Biz/Econ
136 01/03/18E/BSQ1691.0067.9040.00   798.90Econ/Biz
137 09/03/18W/LJL11,395.00172.1050.00   1,617.10Prem Econ/Econ
Booking Class code            
CarrierClassRemarks           
JLLEconomy          
JLWPremium Economy          
KEHEconomy          
KEKEconomy          
NHDBusiness          
SQBEconomy          
SQCBusiness          
SQDBusiness          
SQEEconomy          
SQJBusiness          
SQNEconomy          
SQQEconomy          
SQSPremium Economy          
SQTEconomy          
SQYEconomy          
SQZBusiness          
TGQEconomy          
2 REPLIES 2
parry2k
Super User
Super User

@Grace1 here is the solution, add column in each table

 

New column in BookingClass Table

CarrierClassKey = BookingClass[Carrier] && BookingGlass[Class]
New column in Sales Table CarrierClassKey = Sales[Carrier] && Sales[Class]

Once you have above columns added, set relation between these two table on this new column. After relationship, you add another new column in sales table to get class description

 

Class Description = RELATED( BookingClass[Remarks])


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

v-qiuyu-msft
Community Support
Community Support

Hi @Grace1,

 

From your post, the Class Description column should exist in Sales Table. Would you please clarify the words "I like to obtain Class Description in Sales Table from Booking Class"? 

 

In Power BI desktop, only one active relationship is supported between two tables. You can create a relationship between Carrier columns in these two tables with many to many relationship.  For detail information, I would suggest you go through this document: https://docs.microsoft.com/en-us/power-bi/desktop-many-to-many-relationships

 

q3.PNG

 

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.