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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Allegro
Helper I
Helper I

select a single value from a many to many relation base on a field in the fact table

hi everyone!

so i need to create a field for table in a report, this field comes from a table name station, my problem is that the data comes from a many to many relation and depending on a value from my fact table could be one or another station, along other conditions.

to give you an idea here is the model, its one fact table (Data_Workitems), two dimension tables (station & Pstn number) and a bridge table (stationpstnnumber) meaning one pstn number could be assign to many stations and a station could be assign to many pstn numbers

 

Allegro_0-1661456658700.png

'stationpstnnumber'[stationid]   * -<-1  'station'[id]

'stationpstnnumber'[pstnnumberid]   * <--> 1 'pstnnumber'[id]

'DATA_Workitems'[toAddress] * -<- 1 'pstnnumber'[name]

 

in the Data_Workitems table the pstn number is know as the field name ToAddress, its the phone number to which clients dial to, so from there we have the ToAddress which could be assign to many stations, now to get the right station of the many that could be asign to the pstn number there is also another field on the fact table Data_Workitems called fromAddress which is the phone number from where the client is calling, the first three digits of this number is called the area code, now the station table has also a field called areaCode that contain muliple 3 digit numbers separated by a space like this:

 

Allegro_0-1661885620219.png

 

so from the many stations assign to the pstnnumber (or the ToAddress on the fact table) we are going to return the one that contains the 3 digits from the FromAddress field of the fact table, so depending on the fromAddress the station name could vary,

 

if non of the 'station'[areacode] contains the first 3 digits of the FromAddress a blank() is return, if more than one 'station'[areacode] assin to the ToAddress field contains the first three digits of the FromAddress return the one with the highest 'station'[modifiedAT]

 

if you know the solution to my problem or you reccomen some tips would be much appreciated, i have been struggling with this for a while

thanks

2 REPLIES 2
Allegro
Helper I
Helper I

Hello @tamerj1 

its a simple table a bit long, I use a Date field, the toAddress field mentioned before and the rest of the table are measures calculating some attributes of the phonecall made, it looks like this

 

Allegro_1-1661890487270.png

 

 

 

tamerj1
Super User
Super User

Hi @Allegro 

how does your table visual look like? What columns are you using to slices by in the this table?

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.