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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
lattys
Frequent Visitor

adding / sum lookupvalue

Hello Everyone!

 

Quick question is there a way to add up values that are coming from a measure that uses lookupvalue? 

 

Here's the measure: 

lookupvalue = LOOKUPVALUE(Report[SUM_SERVICE_MONTHLY_FEE_HUF];Report[Custom_date]; [TOP2]; Report[LINK_CODE]; [link_select] )

Basically the [link_select] is just the link code, I dunno I just put it there just to be sure. (Link code is a key-like column)

and it uses this measure:

TOP2 = CALCULATE( FIRSTNONBLANK(TOPN(2;CALCULATETABLE(VALUES(Report[Custom_date]);DATESBETWEEN(Report[Custom_date];BLANK();SELECTEDVALUE(Report[Custom_date];LASTDATE(Report[Custom_date]))); GROUPBY(Report; Report[LINK_CODE]));Report[Custom_date]); 0))

[Custom_date] is a date column that I created using 3 date columns. It can contain duplikates.

 

 

Basically I need a measure/column whichever fits, to get the previous date data (e.g sum fee, how many distinct link code and other summed products). I wrote sum, but I only need it when the date is agregated to months or groups.

 

Thank you 🙂

Viki

3 REPLIES 3
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @lattys,

 

As I know, it is not able to use a LOOKUPVALUE function in  measure formula. From above measure formulas, I cannot understand what you were trying to achieve, would you please share some sample data and show us your desired result?

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
Community Champion

So typically, you use VAR to create a temp table using SUMMARIZE or ADDCOLUMNS and then feed that into a SUMX or something along those lines. See the basic technique here:

https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thank you 🙂

 

I have already tried this one, but ones again like this:

sumx = SUMX(SUMMARIZE(Report; Report[LINK_CODE];Report[Custom_date]; "look"; [lookupvalue]);[look])

sumx = SUMX(ADDCOLUMNS(Report; "look"; [lookupvalue]; "link"; Report[LINK_CODE]; "date"; Report[Custom_date]);[look]) 

 and also when I tied to make a separate table I get this error:

A table of multiple values was supplied where a single value was expected

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.