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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Can anybody please help me to fix my attached rate and dups?

Hello, 
 
Can anybody please help me to fix my attached rate and duplicate issue on Department? 
 
I trying to get the attached rate by Department (Ops_Line_dim.Dept). 
 
When I join Opportunity Line (Ops_Line_dim) to the Opportunity table (Opportunity _dim) it will create duplicates due to Department (it's going to create two raws, each for the department). When I create my attached rate this will cause everything to go wrong. 
AttachRate = DISTINCTCOUNT('Opportunity _dim'[Ops_Line_dim.Opp.Id])/DISTINCTCOUNT('Opportunity _dim'[Id])
 
Capture.JPG
I am not sure to fix this, do I have to create a different column for each department or consider this on visualizing the data. 
 
It will probably make sense when you see my data, so please below for the attached data
Data
Pbix File
Any help would be appreciated. I am kinda stuck and could not move forward. 
1 ACCEPTED SOLUTION

Hi,

Try this measure

AttachRate = DISTINCTCOUNT('Opportunity _dim'[Ops_Line_dim.Opp.Id])/countrows('Opportunity _dim')
Hope this helps.
Untitled.png

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

View solution in original post

11 REPLIES 11
Ashish_Mathur
Super User
Super User

Hi,

Could you please explain what attachrate is?  I can see from your formula that you are dividing 2 distinctcount of ID measures but that should be 100% - so i do not see a problem.  Perhaps, i need to understand what attach rate actually is.


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

@Ashish_Mathur , Thank you for taking the time to review my post. 
 
Attachrate is the formula that I used to create the attach rate. I don't think it is working right, as you can see it showing 100% for every department. The way it works, the Opportunity table (Opportunity _dim) has all the opportunities and the opportunity line has what we win. I did a left join to the opportunity by opportunity ID. This will give all the IDs that are matching with opportunity and also null IDs as well. Basically, I will calculate all the nulls and matching ids. The issue is the opportunity iAd can have multiple ids's when join. I think This is causing the issue. 
 
I don't know if this makes sense for you, but it will be easier to understand if you take look at my Power Bi file. If you have time. 
 
Any idea to fix this will be really appreciated. 
 

Hi,

In the Opportunity_dim table, there should be a Department column.


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

@Ashish_Mathur Opportunity table does not come with a  Department column. Is there a way we can create a separate column for each department? I am not sure just wondering how to do this. Thanks 

Hi,

Try this measure

AttachRate = DISTINCTCOUNT('Opportunity _dim'[Ops_Line_dim.Opp.Id])/countrows('Opportunity _dim')
Hope this helps.
Untitled.png

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

@Ashish_Mathur  Thank you so much, this looks promising. So you did join with two tables on Manage Relationships? 

No.  I just edited your measure (posted in the previous message).


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

@Ashish_Mathur Again, thank you for the quick response. I was working on it and, 

 

In this case, it is going to count duplicates right and give us a kinda wrong attach rate. Please correct me If I am wrong if Opttunity Line has two departments ( For Ex, Opps ID  xyz = product and xyz = Education) Then we join this to matin Opttunitry table, it will show 2 rows. When we do a" countrows",  it will take/count duplicates as well right? Please let me know if I am confusing you. 

Hi,

In the denominator, it will simply count all the rows in the Opportunity_Dims Table. 


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

@Ashish_Mathur  Thank you so much for your help. this works. I really appreciate your time. 

You are welcome.


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

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.