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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Magpie_Rob
Helper I
Helper I

DAX - recreate table for model

Hello,
I'm trying to create a DAX bridge table for my model,

 

I have created the table using a union to get a 1:* relationship, in the bridge table I would like to get a field from the many. in the image below I'm expecting the top result where it returns the MAX number_of_accounts for the dupe_id. But I'm getting the lower result. where its bringing back the max for the table, rather than in context for the Id.  

Magpie_Rob_1-1634894026797.png

Magpie_Rob_2-1634895813998.png

 

I have also included a picture of the model. Qty Account I have added in as a Cal Column, the DAX for Qty Accounts is as below I have also tried MAXX. 

Qty Accounts = MAX('Multiple Account Customers'[number_of_accounts])
 
Thanks
Rob



 

 

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @Magpie_Rob ,

According to your description, you want to get the max of number_of_accounts for the value of Qty Accounts,the MAX('Multiple Account Customers'[number_of_accounts]) bring back the max of the table, you can use the CALCULATE for the max of the id. Here's my solution.

vkalyjmsft_0-1635232425041.png

It's the details of CALCULATE DAX bellow.

https://docs.microsoft.com/en-us/dax/calculate-function-dax

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @Magpie_Rob ,

According to your description, you want to get the max of number_of_accounts for the value of Qty Accounts,the MAX('Multiple Account Customers'[number_of_accounts]) bring back the max of the table, you can use the CALCULATE for the max of the id. Here's my solution.

vkalyjmsft_0-1635232425041.png

It's the details of CALCULATE DAX bellow.

https://docs.microsoft.com/en-us/dax/calculate-function-dax

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Magpie_Rob , What value add Dup Bridge table is doing. Because the model was 1-1 then you could have made that 1- M by force.

 

Can you share what is the need

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Hi @amitchandak
thanks for getting back to me .

 

So the 2 tables come from the same source but represent diffrent things. I'm looking for duplicate accounts where the ID's are diffrent but the combination of postcode and surname is the same. 

So the 1:1 relationship is just linking the unquie ID's and not the duplications. the dupe_id is the combination of postcode and surname but when drilling through, it filters to only matching rows where I need all rows with that postcode / surname id.

I'll stip out the sensive data and share shortly

 

Magpie_Rob_0-1634908802250.png

Magpie_Rob_1-1634908811067.png

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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