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
Anonymous
Not applicable

Some calculations not correct

Hi guys, below is the relationship between the tables Daily_Business_Confirmed & Business_Full_Quote, where policy reference is the field that links the tables together.

 

Capture1.PNGCapture2.PNG

The first visual shows the number of sales, the middle visual is a count of the number of quotes and the last visual is the click to sale %, which is the following measure = sales count/click count. Some of the percentages are correct some are not, any ideas why?

11 REPLIES 11
MFelix
Super User
Super User

Hi @Anonymous ,

 

Being a one to many relationship set the filter directionality to single side instead of bidirectional.

 

Also be sure to use the column on the one side as part of your visuals instead of the column from the many side.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi it doesn't allow me to set the direction of the relationship to the 'one' in the relationship

Hi @Anonymous ,

 

You should change the highlited optionin the relationship table to single:

Relation.png

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Thanks, one other question I have is lets say that all the pol references in the Business_Confirmed table are contained in the Business_Full_Table, however what if the Business_Full_Quote table (which is the many in the relationship) contain policy references which are not in the Daily_Business_Confirmed table?

Hi @Anonymous ,

 

If you have references that are on one table but not on the other that will give you blank results or incorrect results.

 

A workaround for this is to create a table with unique values from both tables and then use that table to relate the other two that way you will be abble to get the full results.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

How could I do this? 

Hi  @Anonymous ,

 

Create a new table using the following DAX code:

 

Table_Union = DISTINCT(UNION(DISTINCT('Table[Column]), DISTINCT('Table2'[Column])))

The column for table and table 2 should be the ones you want to relate then make a relationship one to many from this table to the other two.

 

You can also do this in Query editor appending both tables (only the column you need) on a single query and clean duplicates.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi, thanks for your help, you have been very helpful, however some calculations are still not correct, these three visuals at the top are all correct.

 

Capture 4.PNGCapture 5.PNG

The counts on these bottom three visuals is correct however not all the percentages in the last visual are correct.

E.g. 

10/112 = 8.93%, the visual has this as 8.85% 

143/569 = 25.13%, the visual has this as 25.22%

But the last set of figures gives the correct percentage:

131/532 = 24.62% - which is correct!

 

Im wondering if you can help me, I have tried to filted out errors but this has not made a difference.

 

 

Hi @Anonymous ,

 

Check if the relationships are set with one to many for both tables and the cross filter is set to single.

 

Can you share a sample of the file? if information is sensitive please send trough private message.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



amitchandak
Super User
Super User

Hope it has been done like

calculate(divide(sum(sales count),sum(click count))

Means divided summarized data.

Anonymous
Not applicable

Hi Amit, thank you for help but this doesnt work

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.