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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
phhb
Regular Visitor

New column in table that populates based on another table

Hi everyone,

 

I'll try to be as clear as possible:

 

I'm working on some data in which each observation is a single transaction ID (about 30000 observations). There's variables for location (province theres about 100 of them) and for type of event. I have a separate table in my model that corresponds population to each province.

What I want to do is to add a new column to the main table (the one that contains every single observation) that populates based on population for the respective province.

Is my only solution to write a neverending ifelse function in DAX that does this or is there a more elegant and simple solution?

 

Edit:

I'm including a sample data set with randomized values, as suggested by @ams1 (thanks!):

 

Table with transaction ID and geographical info

IDjurisdictionprovince
546541LocalProvince1
4513215LocalProvince2
2418574LocalProvince2
121357LocalProvince3
248576LocalProvince5
454612LocalProvince1
374884LocalProvince2
84668LocalProvince3
468541LocalProvince4
6848634LocalProvince2
88465LocalProvince5
68484LocalProvince1
4LocalProvince2
55684LocalProvince3
46514LocalProvince5
36464LocalProvince3

 

 

Reference table with population per province:

provincepopulation
Province198650
Province2153465
Province3175462
Province4356489
Province520560

 

Thanks in advance!

1 ACCEPTED SOLUTION
ams1
Super User
Super User

Hi @phhb ,

 

Please provide sample data for the tables, otherwise there is a HIGH probability you will NOT get an answer. 🙂

View solution in original post

3 REPLIES 3
phhb
Regular Visitor

So, with a fresh cup of coffee in a new morning I realized I am a noob and should have just used the Merge query button. i'm closing the topic -.-

ams1
Super User
Super User

Hi @phhb ,

 

Please provide sample data for the tables, otherwise there is a HIGH probability you will NOT get an answer. 🙂

phhb
Regular Visitor

Thanks for the warning, I've included it in the original post

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors