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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

VLOOKUP from Excel to Power Bi

Hi Everyone, 

 

I am recently new to Power BI and I am struggling on a project. I am trying to use LOOKUPVALUE but can't seem to figure it out. I have confidential data, so I've created example tables with what I am trying to achieve. I am trying to lookup the material code from the sales table and see if it is on the Detail Only Code table. See below tables. 

 

I would like to eliminate the last two columns in excel and have Power Bi add a calculated column. Essentially, my end goal to to have the revenue from the Detail service alone. I also want the revenue from any sales order that included a Detailing line item. This is where I get the total ticket column. I have pivot tables in excel but want to visualize it on Power BI. 

Screen Shot 2022-01-28 at 2.30.58 PM.pngScreen Shot 2022-01-28 at 2.32.05 PM.pngScreen Shot 2022-01-28 at 2.37.45 PM.png

 

Please let me know if you have any suggestions for translating these results in Power BI using the first 5 columns. Thanks in advance! 

 

Here is a link to my spreadsheet. https://docs.google.com/spreadsheets/d/1aLRY67p4U1MWQDpUJSRLZkjLCYwHw9bp/edit?usp=sharing&ouid=10052... 

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create two measures about it.

Sum in = CALCULATE(SUM('Sales Table'[Net Revenue]),FILTER('Sales Table',[Material] in VALUES('Detail Only Code'[Material Code])))
Customersum =
CALCULATE (
    SUM ( 'Sales Table'[Net Revenue] ),
    FILTER (
        'Sales Table',
        [Customer]
            IN SUMMARIZE (
                FILTER (
                    'Sales Table',
                    [Material] IN VALUES ( 'Detail Only Code'[Material Code] )),
                [Customer])))

The final output is shown below:

vyalanwumsft_0-1643852871988.png


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create two measures about it.

Sum in = CALCULATE(SUM('Sales Table'[Net Revenue]),FILTER('Sales Table',[Material] in VALUES('Detail Only Code'[Material Code])))
Customersum =
CALCULATE (
    SUM ( 'Sales Table'[Net Revenue] ),
    FILTER (
        'Sales Table',
        [Customer]
            IN SUMMARIZE (
                FILTER (
                    'Sales Table',
                    [Material] IN VALUES ( 'Detail Only Code'[Material Code] )),
                [Customer])))

The final output is shown below:

vyalanwumsft_0-1643852871988.png


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

AlexisOlson
Super User
Super User

You can write a measure like this to get the $180.

CALCULATE (
    SUM ( Sales[Net Revenue] ),
    Sales[Material] IN VALUES ( Detailing[Material Code] )
)

 

However, a better solution would probably be to have a dimension table that has all of the material codes and an extra column that categorized them into whatever categories you want (where 101, 102, 200 are all in the "Detailing" category). If you have this dimension table related to your sales table, then you don't need to write measures to do the filtering; you can add a slicer on the category and select whichever ones you want.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.