Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Superheroes!
I am having an issue with my Lookup-function returning a table instead of a single value.
I have two relevant tables, plus date.
The Lookup function below is meant to return the price for a product given to a customer for the year in question, and multiply with the number if units.
However, there appears to be duplicates in the Account Overview (excel)table, i.e. multiple prices for the same product for the same customer withing the same year, and I would like to bypass this by having the below formula only return the highest price found. In short, if the formula returns more than one price for the same product to the same customer within the same year, I would only want the highest one.
Solved! Go to Solution.
Hi @Anonymous
Revenue =
SUMX (
f_Forecast,
f_Forecast[Units]
* CALCULATE (
MAX ( 'dAccount Overview'[Price per unit] ),
FILTER (
ALL (
'dAccount Overview'[SKU],
'dAccount Overview'[Number],
'dAccount Overview'[Year]
),
'dAccount Overview'[SKU] = f_Forecast[SKU]
&& 'dAccount Overview'[Number] = f_Forecast[Number]
&& 'dAccount Overview'[Year] = YEAR ( f_Forecast[Forecast Shipping Date] )
)
)
)
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hi @Anonymous
Revenue =
SUMX (
f_Forecast,
f_Forecast[Units]
* CALCULATE (
MAX ( 'dAccount Overview'[Price per unit] ),
FILTER (
ALL (
'dAccount Overview'[SKU],
'dAccount Overview'[Number],
'dAccount Overview'[Year]
),
'dAccount Overview'[SKU] = f_Forecast[SKU]
&& 'dAccount Overview'[Number] = f_Forecast[Number]
&& 'dAccount Overview'[Year] = YEAR ( f_Forecast[Forecast Shipping Date] )
)
)
)
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |