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
CC2019
Frequent Visitor

Percentage of total from 2 table

Hi Team,

 

I have three tables - Customers (customer details), Feedback (Feedbacks given by customers), Sales(sales by customers). Id column in Customers table is used to link tables. I want to find percentage of sales by each customer type(customer type is a column from feedback table).

3 type of customers are "P", "D","Ps".

I used following calculation

Pr_Sales% =
var total=
CALCULATE(SUM(Sales[Sale]),
Feedback[Type]="P")
Return
DIVIDE(total,SUM(Sales[Sale]))
It gives me a value. But I want three percentages be summed upto 100.
 
I have attached the screenshots. Kindly help
result.jpgUntitled.jpg
4 REPLIES 4
v-diye-msft
Community Support
Community Support

Hi @CC2019 

 

Would you mind trying to add below measure, then calculate the percentage:

 

SUMSales = CALCULATE(SUM(Sales[Sale]),FILTER('Feedback', Feedback[Type]="P"||Feedback[Type]="D"Feedback[Type]="Ps"))
Pr_Sales% =var total=
CALCULATE(SUM(Sales[Sale]), Filter('Feedback', [Type]="P"))
Return
DIVIDE(total,SUMSales)

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Hi @v-diye-msft ,

 

It returns the same result as in the screenshot. Still not adding to 100%

Hi @CC2019 

 

Could you please share your simple worksheet/dummy pbix preferable? 

 

Community Support Team _ Dina Ye
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

As the customer has more than one feedback, it is not rolling up to 100%. So you need to select only one feedback. Or need do changes to get sales also counted more than once if there is more than one feedback. 

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.