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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
awolf88
Helper II
Helper II

Lookupvalue over 2 Columns

Hi girls & guys,

 

I have 2 very simple tables: 

1.) Sales

Screenshot 2021-11-28 122404.png

2.) Product Table

Screenshot 2021-11-28 122518.png

 

Now as you can see within the Product table, there's one item, "2536" or "TV Remoate", that comes at different pricing options, depending on the quantity customers purchase it at. 

Since there are no unique values, I'm staying away from building a relationship within the model itself. I would much rather create a separate, calculated column within the Sales table, listing the price according to quantity ordered. 

 

Screenshot 2021-11-28 122501.pngNow I would presume, that the easiest way would be a Lookupvalue function creating the column. But I'm having trouble entering it so it aggregates properly. 

 

Could anyone kindly help me out or suggest if there's an easier option to do this?

 

Thanks in advance!

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I suggest creating Product table like below.

 

Picture1.png

 

And then, Range of MIn column and Max column can be used like below.

Picture2.png

 

Please check the attached pbix file. All Calculated Columns are in the attached pbix file.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

View solution in original post

3 REPLIES 3
awolf88
Helper II
Helper II

Hi there! 

may I pick up this problem from before and inquire about one more piece of coding to what has worked as a charm so far? 

My Product table now has 2 additional columns with a mix of current and historic prices that have changed due to price increases. I would now need the code to not only aggregate by quantity amount but also by which time window the sales price has been valid for if that makes sense? 

 

awolf88_0-1649079566064.png

Thanks guys!

 

awolf88
Helper II
Helper II

Did the trick, beautifully! Thank you kindly!!

Jihwan_Kim
Super User
Super User

Hi,

I suggest creating Product table like below.

 

Picture1.png

 

And then, Range of MIn column and Max column can be used like below.

Picture2.png

 

Please check the attached pbix file. All Calculated Columns are in the attached pbix file.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

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.