Forum Discussion
Baldy
9 years agoFrequent Visitor
How to use an if statement to create a column based on values from 2 tables
Hi, I am new Power BI and am really struggling to create a column I have 2 tables, 1 that contains stripped down IP address columns and another table that contains an IP range and a location name. ...
- 9 years ago
Hi Baldy,
Based on my test with your sample data, you should be able to use the formula(DAX) below to create new calculate column in Table1 in your scenario. :smileyhappy:
Column3 = CALCULATE ( FIRSTNONBLANK ( Table2[Column4], 1 ), FILTER ( Table2, Table2[Column1] = Table1[Column1] && ( Table1[Column2] >= Table2[Column2] && Table1[Column2] <= Table2[Column3] ) ) )Regards
WillemC
Resolver I
9 years agoI'm assuming you have a connection to a database where you're retrieving the information from?
If so, edit your Query (or create a new one).
This creates a new table with the three fields (col1, col2, col4)
step 1
step 2
step 3
Baldy
9 years agoFrequent Visitor
Sorry no,
The sources are 2 separate spreadsheets that are made available to me via sharepoint.