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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
AltusTellus
Helper III
Helper III

Return value from another table (no relationship) with filter value is blank

Hi all,

I've two tables:

 

1. SalesPrices, with multiple [Item_ID] and [Sales_Price] and connected [account_ID]. When the field [Account_ID] is blank / empty then this means that this is de base sales price.

2. SalesVolumePrices, with [Item_ID]. In this table I would like to add the column [Sales_Price] from table SalesPrices in which case the field [Account_ID] is blank / empty.

 

I've tried verything with LOOKUPVALUE and so on, but nothing works and I'm lost. Someone who can help?

1 ACCEPTED SOLUTION

Hey @AltusTellus ,

 

does the table SalesVolumePrices already exist?

Or do you want to creat it with DAX?

 

If you have to create it, why don't you copy the original table in Power Qery and remove all rows where Account_ID is not empty?

Then you have a prepared table directly from Power Query.

 

Best regards

Denis

View solution in original post

9 REPLIES 9
AltusTellus
Helper III
Helper III

Table [SalesPrices]                                                       Result should be Table [SalesVolumePrices]

Item_ID       Sales_Price       Account_ID                            Item_ID     Standard_Sales_Price
100001         2,20                   95642                                  100001        1,75

100001         1,75

100001         1,44                   98677

Hey @AltusTellus ,

 

does the table SalesVolumePrices already exist?

Or do you want to creat it with DAX?

 

If you have to create it, why don't you copy the original table in Power Qery and remove all rows where Account_ID is not empty?

Then you have a prepared table directly from Power Query.

 

Best regards

Denis

selimovd
Super User
Super User

Hello @AltusTellus ,

 

I guess you want the base sales price as a calculated column in the table SalesVolumePrices.

Try if the following measure works for you as a calculated column:

base sales price =
VAR rowItemID = SalesVolumePrices[Item_ID]
VAR result =
    CALCULATE(
        MAX( SalesPrices[Sales_Price] ),
        SalesPrices[Item_ID] = rowItemID,
        ISBLANK( SalesPrices[account_ID] )
    )
RETURN
    result

  

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi

Hi @selimovd the formula giver no error(s), but the returned value is blank. Any ideas?

 

If the value is an empty sting and not really blank this could be an issue.

Try the following version:

base sales price =
VAR rowItemID = SalesVolumePrices[Item_ID]
VAR result =
    CALCULATE(
        MAX( SalesPrices[Sales_Price] ),
        SalesPrices[Item_ID] = rowItemID,
        SalesPrices[account_ID] = ""
    )
RETURN
    result

 

Thnx for your reply, but this gives me the same results: all blanks. To be sure, here is my example:

 

Table [SalesPrices]

Item_ID      Sales_Price      Account_ID

100001        1,50                  76548

100001        1,25                

100001        1,10                  74888

 

Table [SalesVolumePrices]

Item_ID    Standard_Sales_price
100001      1,25

 

So, the result must be 1,25 because that's the value without an Account_ID in the row.

 

Do you have more suggestions?

@selimovd do you have another solution for me? In advance many thnx!

amitchandak
Super User
Super User

@AltusTellus , can you share some sample data. refer my two videos. It has 4 ways

 

https://www.youtube.com/watch?v=czNHt7UXIe8

https://www.youtube.com/watch?v=Wu1mWxR23jU

 

you may have add additional filter

&& isblank( [Account_ID])

or

 

&& not isblank( [Account_ID])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak The two tables don't have a relationship, do you have another solution?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.