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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
mterry
Helper V
Helper V

Catch-all when no reference

I have a data table that has various info on it, all linked to location codes. I have a separate reference table that links those location codes to the common names of the locations. Sometimes there are instances where there is info on the data table that is linked to a code that is not truly a location, so not included on the reference table. What I would like to do is somehow include a label, i.e. 'misc', that is used for every instance when there is no location found, but I'm stuggling to do so. There isn't one or even several particular codes that I can put on the refernce table to address this as there are hundreds (maybe thousands) of potential codes that could show up on the data table..... 

 

Any assistance is appreciated 

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@mterry

 

Hi, You can use a calculated column like this

 

Location =
IF (
    RELATED ( Table2[Location] ) = BLANK ();
    "Misc";
    RELATED ( Table2[Location] )
)

Regards

 

Victor

Lima - Peru




Lima - Peru

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



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...

Okay here's a sample of specific data to help with my issue. The first table is the location reference table. The second table shows the actual data in our system, the third column being what I'm trying to figure out. The relationship between the two tables is the Code. In this sample, the charge codes 'QM456' and 'CA456' do not have an associated location, so what I'd like to have shown (as I've manually entered in the second table to show what I'd like) is 'Misc' for the location. The issue is that QM456 and CA456 are just made up examples, I have no idea what the Codes will be that aren't associated with locations, but I do know that Codes will come throug that don't have a location, so I'm looking for a way to have any code that doesn't exist in the reference table default to a location of 'Misc'. 

 

CodeLocation
TX123Austin, TX
CO123Denver, CO
CA123Sacramento, CA
FL123Miami, FL

 

CodeAmountLocation
TX123 $                    100.00Austin, TX
QM456 $                    100.00Misc
CA123 $                    100.00Sacramento, CA
CA456 $                    100.00Misc

Hi,

 

Try this

 

=IF(ISBLANK(RELATED(Table1[Location])),BLANK(),RELATED(Table1[Location]))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you both for the help, it worked

Vvelarde
Community Champion
Community Champion

@mterry

 

Hi, You can use a calculated column like this

 

Location =
IF (
    RELATED ( Table2[Location] ) = BLANK ();
    "Misc";
    RELATED ( Table2[Location] )
)

Regards

 

Victor

Lima - Peru




Lima - Peru

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.