lookupvalue
61 TopicsOne table Vlookup equivalent in DAX
Dear community, I'm trying to get shipment C013720578 to be shown in column Group for all rows. Shipment C013720578 is the main shipment, out of 4 shipments linked to invoice 1891846520. I need to do this for all Invoices in column Invoice. My first try was lookupvalue Column = LOOKUPVALUE('BRIDGE FULL'[Shipment],'BRIDGE FULL'[Invoice & main],'BRIDGE FULL'[Invoice & Shipment Type]) This wouldn't work becuase there are duplicates (in the Search Value I think), and I got this error: A table of multiple values was supplied where a single value was expected. How do I modify the formula below please? or something completely different? (hint: shipment C012293295 currently shown in column Group is the very first shipment of the entire big table) Invoice Shipment Shipment Type Shipment Type - Main Invoice & main Invoice & Shipment Type Group 1891846520 C013720583 ZT13 not main 1891846520main 1891846520not main C012293295 1891846520 C013720577 ZT11 not main 1891846520main 1891846520not main C012293295 1891846520 C013720579 ZT13 not main 1891846520main 1891846520not main C012293295 1891846520 C013720578 ZT12 main 1891846520main 1891846520main C012293295 1891846523 C013720577 ZT11 not main 1891846523main 1891846523not main C012293295 1891846523 C013720579 ZT13 not main 1891846523main 1891846523not main C012293295 1891846523 C013720586 ZT13 not main 1891846523main 1891846523not main C012293295 1891846523 C013720578 ZT12 main 1891846523main 1891846523main C012293295 1891846524 C013720579 ZT13 not main 1891846524main 1891846524not main C012293295 1891846524 C013720586 ZT13 not main 1891846524main 1891846524not main C012293295 1891846524 C013720577 ZT11 not main 1891846524main 1891846524not main C012293295 1891846524 C013720578 ZT12 main 1891846524main 1891846524main C012293295Solved716Views0likes4CommentsLOOKUP with conditions
I have two tables and I would like a lookup from one to the other based on a condition. I have a "Sites Information" table which shows me [Location] [Installation Date] [% first 3 months] [3 months date] [% after 3 months] per venue we have I have an "All Payment Data" table which has the [Location] and [Date of Order] and provides individual orders taken and which site this can be attributed to I've managed to do a simple lookup between [Location] to bring back all of the fields in "Sites Information" in "All Payment Data". However, I would like a column in "All Payment Data" which tells me what % revenue from each order should be going to the venue based on the date of the order: If [Date of Order] is (>= [Installation Date] and < [3 months date]) then [% first 3 months] If [Date of Order] is >= [3 months date] then [% after 3 months] Could anyone advise? Thanks!Solved942Views1like2CommentsAdd column to Power Bl tab where value is from another row in table where 3 columns match criteria
In the table below, records 1,2,3,5 DAX formula copies city names from Town to the Missing Town as data was already available. New Column Number First Name Second Name Birthday Visits Distinct Town Missing Town 1 Jack Dee 16/06/2011 0 2 London London 2 Paul Jacob 01/07/2014 0 1 Paris Paris 3 Peter James 07/03/2015 1 2 Madrid Madrid 4 Viktors Thomas 27/12/2008 1 1 5 Eliana Plumb 05/02/2012 1 1 Miami Miami 6 Kausar Defoe 10/10/2008 0 1 7 Khadija Singh 19/11/2011 1 1 Tokyo Miami 8 Krish King 24/07/2008 0 1 9 Ibrar Plaice 02/09/2011 1 1 10 Nash Chow 07/05/2008 0 1 11 Jack Dee 16/06/2011 1 2 London 12 Ahmad Santosh 19/02/2008 0 1 13 Peter James 07/03/2015 0 2 records 4,6,8,9,10,12 and 13 do not have the Town and as there are no other matching records with Town that meet the 3 criteria First Name, Second name and Birthday , so DAX formula will leave them empty on the Missing Town Column, unless we can find another record that matches the 3 cirtiera. DAX formula is needed for 'Missing Town' column so Record 11 can pull Town into the Missing Town column from record 1 that matches the 3 criteria which has the Town. Hope that helps claridy what I am trying to do, bnasicall pupulating a colum if the data is available in one ofthe other records in the table if 3 criteria are met.Solved1.4KViews0likes6Comments"Not a fully qualified column reference"
All day I've been trying to figure out why RELATED, RELATEDTABLE, and LOOKUPVALUE don't work for me, and then I realized none of them are working because I'm using Direct Query, but it turns out I'm NOT actually using Direct Query (but should be and need to fix that.) In the meantime, I'm getting the error message that my column is not a "fully qualified column reference"- why else wouldn't my columns be fully qualified if I'm in Import Mode? Meanwhile, I need a new column in the PROPERTY table that lists all the tenants asscociated with each PROP_CODE. The PROP_CODE's match, and you can see it's 1-to-many (which is an issue- I want Power BI to create extra lines in the PROPERTY table to accomodate all the tenants for each PROP_CODE.) RELATED, RELATEDTABLE, and LOOKUPVALUE don't work for some reason. Thanks in advance! Thank-you for your help!Solved2.4KViews0likes2CommentsNeed Help With LOOKUPVALUE or need ideas
Hello, I am a little new to PowerBI and I am trying find a function like Excel's VLOOKUP that will allow me to create a column in Invoice Table 1 that pulls correct margin value from the time frame of the invoice instance. I need a function not a join please! Table 1: Invoice_Table invoice_number ID start_date end_date Created_Field_Margin(Margin_Table) 5456 1 10/20/2023 11/20/2023 5115 2 1/19/2024 2/19/2024 15156 3 3/25/2024 4/26/2024 5155 4 1/18/2024 2/22/2024 46565 5 11/20/2023 12/10/2024 Table 2: Margin_Table ID start_date end_date Margin 1 10/20/2023 1/10/2024 0.32 2 10/21/2023 1/11/2024 0.55 3 10/22/2023 1/12/2024 0.11 4 10/23/2023 1/13/2024 0.55 5 10/30/2023 1/14/2024 0.57 1 1/11/2024 5/21/2024 0.35 2 1/12/2024 5/22/2024 0.62 3 1/13/2024 5/23/2024 0.16 4 1/14/2024 5/24/2024 0.54 5 1/15/2024 5/25/2024 0.58 Desired Output: This created Margin field would pull the Margin value from the Margin_Table based on the 'ID' and where the invoice falls within start_date and end_date invoice_number ID start_date end_date created_field_margin(Margin_Table) 5456 1 10/20/2023 11/20/2023 0.32 5115 2 1/19/2024 2/19/2024 0.62 15156 3 3/25/2024 4/26/2024 0.16 5155 4 1/18/2024 2/22/2024 0.54 46565 5 11/20/2023 12/10/2024 0.57Solved1.1KViews0likes5CommentsLookupvalue results missing
Hi all, I have tried to create a Lookup between two tables. What I am trying to do is to determine what is the max amount of days that a project can take based on the SLA table. This SLA has a variety of critera: Wordcount, service needed, department and type of material. I have odd results and only one of the max SLA get populated, the rest they do not seem to be matched, anyone would know why?Solved850Views0likes3CommentsReturning values from a many to many relationship
I have an event table and an employee table that share a many to many relationship. I want to to polulate the role that an employee had at the time of the event. For example, the first event occurred to "Bob" on 1/4/2020, and I can see in the Employee table that he was an Analyst at that date. But he was a consultant when the second event that involved "Bob" occurred. Event Table Date Name 1/04/2020 Bob 1/07/2020 Bob 3/05/2021 Jill 13/02/2022 Fred Employee Table Name Role Start Date End Date Bob Analyst 1/01/2020 1/06/2020 Bob Consultant 2/06/2020 1/01/2023 Jill Consultant 15/07/2018 3/12/2020 Jill Trainer 4/12/2020 1/01/2023 Fred Analyst 1/05/2021 1/01/2023 Desired Result Event Table Date Name Role 1/04/2020 Bob Analyst 1/07/2020 Bob Consultant 3/05/2021 Jill Trainer 13/02/2022 Fred Analyst I've been banging my head against the wall for a while on this but I figure it shouldn't be that hard!?! Any help would be appreciated.Solved622Views0likes2CommentsDAX lookupvalue with date condition
Hello, I want to lookupvalue based on a particular date. There are 2 tables. Table 1 with meter_id, power outage column and measurement date. Table 2 with child meters associated with the meter_id from table 1. Now I want to lookupvalue in table 2 based on following conditions: 1. Meter_id with power outage flag set to 1 in table 1 2. Lookup values only for meter_ids with the selected measurement date. The measurement date is linked to a calendar table and the calendar date from calendar table is used to select the measurement date. Finally in table 2 I want to set a power outage flag for those child meters associated with the meter_id from table 1 For example: If the selected date : 10.5.2023, then only the 100A meter with power outage flag set to 1 should be used to lookup value in table 2 and its corresponding child ABC1 should have the child power outage set to 1. The other child meters shouldn't be set to 1 because the power outage for its main meter was not on 10.5.2023 Table 1 Meter ID date power outage 100A 10.5.2023 1 1000B 11.6.2023 1 123C 22.11.2022 145D 13.5.2023 1 Table 2 Meter ID Parent ID child power outage ABC1 100A 1 X1008 1000B XV200 145D XY100 146E Currently, I wrote a DAX function in table 2 as follows: child_power_outage = LOOKUPVALUE(table 1[power_outage],table 1[Meter ID],[Parent ID],table 1[power_outage],1) But this gives: Table 2 Meter ID Parent ID child power outage ABC1 100A 1 X1008 1000B 1 XV200 145D 1 XY100 146E Is there a way to include a date condition or date filter in lookupvalue. ? I have tried merging table 1 and table 2, but power query is not allowing it because table 1 has other queries merged with it and it says it references other queries, so it may not directly access a data source, so rebuild this data combination. Any little bit of help is much appreciated. I am stuck at this problem for a long time. Thanks a lot.5.3KViews0likes5CommentsDudas con Lookupvalue
Hola a tod@s, LOOKUPVALUE ( 'Foto BI Inicial Detallada'[Número documento], 'Foto BI Inicial Detallada'[Número documento], 'Foto BI Final Detallada'[Número documento], 'Foto BI Inicial Detallada'[Fecha Foto],Date(2023,9,4),"No" ) Como podría sustituir Date(2023,9,4) por el valor de un filtro seleccionado de 'Foto BI Inicial Detallada'[Fecha Foto] por el usuario, he intentado con MAX, MIN, y no me funciona... Gracias 1000742Views0likes1CommentSummarize table Lookupvalue in Funnel Visual
Hi Everyone, i have the below summarized table "Cover Type Analysis" as per the below : CoverTypeAnalysis = SUMMARIZE('Production ReportV20-V1 Power B','Production ReportV20-V1 Power B'[Cover Type],'Production ReportV20-V1 Power B'[Transaction Year],"Total Premium",SUM('Production ReportV20-V1 Power B'[Cedent Premium])) i have created a new column LastYear: LastYear = IFERROR(FORMAT(CoverTypeAnalysis[Transaction Year],"General Number") - 1,0) i need to calculate PercentageYearlyGrowthByCoverType: PercentageYearlyGrowthByCoverType = DIVIDE(CoverTypeAnalysis[Total Premium] - LOOKUPVALUE(CoverTypeAnalysis[Total Premium],CoverTypeAnalysis[Transaction Year],CoverTypeAnalysis[LastYear], CoverTypeAnalysis[Cover Type],CoverTypeAnalysis[Cover Type]), ABS(LOOKUPVALUE(CoverTypeAnalysis[Total Premium], CoverTypeAnalysis[Transaction Year],CoverTypeAnalysis[LastYear], CoverTypeAnalysis[Cover Type],CoverTypeAnalysis[Cover Type])))/100 i have Transaction Year a Slicer Filter = 2019, everything looks wonderfull and the Funnel is looking correct: I was asked after that to add Quarter and Month Filters to this report, i added them to the summarized table : CoverTypeAnalysis = SUMMARIZE('Production ReportV20-V1 Power B', 'Production ReportV20-V1 Power B'[Cover Type], 'Production ReportV20-V1 Power B'[Transaction Year], 'Production ReportV20-V1 Power B'[Transaction Quarter], 'Production ReportV20-V1 Power B'[Transaction Month], "Total Premium",SUM('Production ReportV20-V1 Power B'[Cedent Premium])) and adjusted PercentageYearlyGrowthByCoverType to be as per the below: PercentageYearlyGrowthByCoverType = DIVIDE(CoverTypeAnalysis[Total Premium] - LOOKUPVALUE(CoverTypeAnalysis[Total Premium], CoverTypeAnalysis[Transaction Year],CoverTypeAnalysis[LastYear], CoverTypeAnalysis[Transaction Quarter],CoverTypeAnalysis[Transaction Quarter], CoverTypeAnalysis[Transaction Month],CoverTypeAnalysis[Transaction Month], CoverTypeAnalysis[Cover Type],CoverTypeAnalysis[Cover Type]), ABS(LOOKUPVALUE(CoverTypeAnalysis[Total Premium], CoverTypeAnalysis[Transaction Year],CoverTypeAnalysis[LastYear], CoverTypeAnalysis[Transaction Quarter],CoverTypeAnalysis[Transaction Quarter], CoverTypeAnalysis[Transaction Month],CoverTypeAnalysis[Transaction Month], CoverTypeAnalysis[Cover Type],CoverTypeAnalysis[Cover Type])))/100 however im getting wrong results as if it excecute the formula for each row and at the it sums all percentages while what i want is to make the calculation for all selected values: also i tried to create a mesure but it returned empty and couldnt load it into Funnel Visual PercentageYearlyGrowthByCoverType mesure = DIVIDE(SUM(CoverTypeAnalysis[Total Premium]) - LOOKUPVALUE(CoverTypeAnalysis[Total Premium], CoverTypeAnalysis[Transaction Year],SELECTEDVALUE(CoverTypeAnalysis[LastYear]), CoverTypeAnalysis[Transaction Quarter],SELECTEDVALUE(CoverTypeAnalysis[Transaction Quarter]), CoverTypeAnalysis[Transaction Month],SELECTEDVALUE(CoverTypeAnalysis[Transaction Month]), CoverTypeAnalysis[Cover Type],SELECTEDVALUE(CoverTypeAnalysis[Cover Type])), ABS(LOOKUPVALUE(CoverTypeAnalysis[Total Premium], CoverTypeAnalysis[Transaction Year],SELECTEDVALUE(CoverTypeAnalysis[LastYear]), CoverTypeAnalysis[Transaction Quarter],SELECTEDVALUE(CoverTypeAnalysis[Transaction Quarter]), CoverTypeAnalysis[Transaction Month],SELECTEDVALUE(CoverTypeAnalysis[Transaction Month]), CoverTypeAnalysis[Cover Type],SELECTEDVALUE(CoverTypeAnalysis[Cover Type]))))/100 appreciate your urgent assistance Thank you in advance Best regards, Georges SabbaghSolved769Views0likes1Comment