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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Non blank value in column

Hi Team,

I have base table as below 

CodeRegionSales
123 10
123ABC20
456 30
456DEF40

 

I have created a Distinct value from code as below

Code
123
456

 

I need to create allokup region column from the base as below.

If the value if blank in region it should look for next value.

CodeRegion
123ABC
456DEF

 

Thanks in advance !

1 ACCEPTED SOLUTION
rusgesig
Helper IV
Helper IV

Try this:

Region Table =
DISTINCT(
    SELECTCOLUMNS(
        FILTER('Table','Table'[Region]<>BLANK())
        ,"Code", 'Table'[Code]
        ,"Region", 'Table'[Region]
    ))
rusgesig_0-1675162021330.png

 



View solution in original post

8 REPLIES 8
rusgesig
Helper IV
Helper IV

Try this:

Region Table =
DISTINCT(
    SELECTCOLUMNS(
        FILTER('Table','Table'[Region]<>BLANK())
        ,"Code", 'Table'[Code]
        ,"Region", 'Table'[Region]
    ))
rusgesig_0-1675162021330.png

 



FreemanZ
Super User
Super User

hi @Anonymous 

try to create a calculated table like this:

Table =
SUMMARIZE(
    BaseTable,
    BaseTable[Code],
    BaseTable[Region]
)
Anonymous
Not applicable

@FreemanZ ,

Thanks for your rply !

This is not working as expected attaching the image.

Raks_0-1675161001408.png

 

Thanks !

 

 

Ahmedx
Super User
Super User

Screen Capture #255.png

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end
https://dropmefiles.com/eahTZ

Anonymous
Not applicable

@Ahmedx ,

 

I am not able to download the file can you please share it again.

Thanks!

jaweher899
Impactful Individual
Impactful Individual

To create the "Allokup Region" column, you can use the DAX formula "CALCULATE" with "IF" and "MIN" functions. Here's the formula:

Allokup Region = CALCULATE(MIN(Base[Region]), FILTER(Base, Base[Code]=DistinctCodes[Code] && NOT(ISBLANK(Base[Region]))))

Assuming your base table is named "Base" and your distinct code table is named "DistinctCodes", you can use this formula in a new calculated column. The formula finds the minimum non-blank value of the "Region" column for each code.

Anonymous
Not applicable

@jaweher899 ,

This code is not working as expected plz find below images. 131 code should have value but in lookup table I still see blank.

 

Raks_0-1675161354828.png

Raks_1-1675161402996.pngRaks_2-1675161422733.png

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors