cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Pulling referential label descriptions from label table

New here and new to Power BI.  Working with a 3rd party DB that has many tables with integers stored in many monthly fields (month 1, month 2...)  in each table.  These integer values relate to one table of master labels, value1 = label1 "AA" 2="BB" ... Is there a way (function, command) that will allow me to join these multiple fields into this "Label" table?  My attempts so far only allow me to have 1 join to this table (month1 to value)?  Do I have to handle this as a conversion on the query/model level?

 

Table1, record 1

tbl1.month1=3

tbl1.month2=5

tbl1.month3=1

tbl1.year =2016

...

 

Table1, record 2

tbl1.month1=2

tbl1.month2=1

tbl1.month3=4

tbl1.year=2016

...

 

TableL.record 1

tblL.value=1

tblL.description="AA"

 

TableL.record 2

tblL.value=2

tblL.description="BB"

...

 

 

 

Sorry this seems like something I should be able to figure out but how do I join the fields tbl.month1 and tbl.month2 and ... to tblL.value to get tblL.description on the report?  must be simple and I am just missing something from the training vids but I have not been able to figure it out.  Any help for a newbie would be appreciated.

 

John

 

John

 

3 REPLIES 3
Highlighted
Super User III
Super User III

Re: Pulling referential label descriptions from label table

Hi John,

it would be easiest if you unpivot the month-columns of your Table1, then merge the TableL on the (newly created) attribut-column, and - if necessary - pivot back.

But normally, the pivot-back operation is not such a good idea for a data model.

 

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

Highlighted
Microsoft
Microsoft

Re: Pulling referential label descriptions from label table

Hi @JohnAnderson,

 

Based on my understanding, your table structure might be:

1.PNG  2.PNG

 

To Join these two tables based on values for each month in Table1 and [Value] in TableL, you should first Unpivot Table1. Select columns Month1, Month2, Month3... then, click "Unpivot Columns" option under Transform tab in Query Editor mode.

3.PNG

 

Then, merge these two tables. (Home -> Merge queries as new)

4.PNG

 

5.PNG

 

If above result doesn't meet your requirement, please figure out how to join tables and show us your desired output with image.

 

Regards,
Yuliana Gu

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

Re: Pulling referential label descriptions from label table

Hi @JohnAnderson,

 

Have you worked it out? If so, would you please mark the helpful reply as an answer so that it can benefit more users? If you still have any question, please feel free to ask.

 

Thanks,
Yuliana Gu

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

Helpful resources

Announcements
Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors