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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Finding value based on row header and a column value

Good Day

 

I want to extract information from another table based on 2 variables. In the below data set I want to determine the "Tub Factor" column so I can multiply it by the loads. Call the below Field "Daily Production"

GregoryPetzer_0-1657601544416.png

To get the tub factor I need to refer to the below field "Material Type". So essentially what it must do is in the "Tub Factor" column I want it to first check the "Fleet Size" and match it to the column in the "Material Type" then check the "Application" and match it to the application. In excel I would do a clustered MATCH inside a VLOOKUP. Something like VLOOKUP(application, "material type", match(fleet size, the top row of "material type"),false)

 

GregoryPetzer_1-1657601596031.png

I have tried to un-pivot the material type field in power query to get the below, howev er i then cannot link the databases via application

GregoryPetzer_2-1657601948582.png

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

HI @Anonymous 
Here is the sample file with the solution based on unpivotted table https://we.tl/t-mPd68FBRV3

1.png

 

Tub Factor = 
MAXX ( 
    FILTER (
        RELATEDTABLE ( 'Material List' ),
        'Material List'[Fleet Size] = 'Daily Production'[Fleet Size]
    ),
    'Material List'[Value]
)

 

View solution in original post

9 REPLIES 9
Mani1404
Regular Visitor

Can you please share the link to Power Bi Sample file. i am doing simalar solution, but stuck in DAX

tamerj1
Super User
Super User

HI @Anonymous 
Here is the sample file with the solution based on unpivotted table https://we.tl/t-mPd68FBRV3

1.png

 

Tub Factor = 
MAXX ( 
    FILTER (
        RELATEDTABLE ( 'Material List' ),
        'Material List'[Fleet Size] = 'Daily Production'[Fleet Size]
    ),
    'Material List'[Value]
)

 

Anonymous
Not applicable

Hi, thanks a lot. There seems to be something wrong with the link, it shows it has 0 files. Can you perhapse assist with sharing via another platform? 

@Anonymous 
I have updated the link in the original reply. Please check and confirm

Anonymous
Not applicable

Works perfectly, thanks very much!

tamerj1
Super User
Super User

Hi @Anonymous 
If you you unpivotted the table then you are on the right track. Why aren't you able to create a relationship? Still you can match even without a relationship bu the relationship would be much easier and faster. Still not clear what exactly are you trying to match and which value are you trying to grap from which table to which table. Cannot fund the Material Type column anywhere in the provided screenshots. Also what exactly is the Tub Factor? Is it the value that you are trying to calculate?
lease provide a simplified dummy sample data along with the expected results.

Anonymous
Not applicable

Sorry, I mean't Material List, not Material Type. I am unsure how to attach a sameple set, should I attach as an excel or a Power BI?

 

Just to simplify and elaborate.

 

I have my main Data "Daily Production" and a table that I need to draw info from "Material List".

 

I was the tub factor column to first check the Fleet size and match the column, and then return associated value in the row matching the Application. Below in the tub factor column is what should be returned.

Daily Production
EIIDApplicationFleet SizeTub Factor
AD4001MMOAD4013.95
AD4001GHAAD4014.55
AD6001ZRTAD6022
AD6002MMOAD6018.5

 

Material List
ApplicationAD20AD25AD30AD40AD50AD60RD90
MMO  10,513,95 18,531
GHA  10,514.55 1931
ZRT   15 2227
BPO   18  30

 

Below is the error I get if I unpivot

GregoryPetzer_0-1657604381754.pngGregoryPetzer_1-1657604432654.png

 

@Anonymous 
Better to share PBI sample file. You can share a download link via onedrive, dropbox, weshare, etc..

Anonymous
Not applicable

See below, let me know if it works. I tried to keep the sample as bare as possible.

 

https://www.dropbox.com/sh/9mt2v32y4akfirr/AACBdcq_jhtt9jytxju6prpua?dl=0

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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