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
Anonymous
Not applicable

Column Name as a reference to another reference table

Hi Team,

 

Good Day !

 

I am wondering if this scenario can be done using dax by creating measure

 

I have table 1 which has customer name and list of products availed and another reference table that has product cost and my goal is to compute for the total product availed

Here are the tables

Table 1

Customer NameProduct 1Product 2Product 3
John Doe12101
Hello World1034

 

ProductsTable

Product NameProduct DescProduct Cost
Product 1blah blah$30
Product 2blahabalah $25
Product 3blah blah$19

 

I would like to add a measure in table 1 with 

 

TotalProductCost = SUM(('Table1'[Product1]*'ProductsTable'[ProductCost]), ('Table1'[Product2]*'ProductsTable'[ProductCost]),

('Table1'[Product3]*'ProductsTable'[ProductCost]))

 

How can I get the specific cost for each product using the column name as reference from table1?

 

Is this possible?

 

Thanks in advance

 

Cheers!

John

1 REPLY 1
ryan_mayu
Super User
Super User

@Anonymous 

i suggest you to transform the data in table 1

select customer name column and unpivot other columns

1.png

2.PNG

then create relationships between two table via product columns

that will be easier for you to do the further calculation





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

Proud to be a Super User!




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.