cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

How to show the % of a column sum in one table vs the count value of a column from another

 
 

Hi i am looking for some help to setup the below:

  I have setup this very simple model with two tables. Customer_Master and Distribution_Data which shows distribution of products to customer outlets. Connected to each other via the customer_id field.

 

The number you see on the bar chart , first bar for example, shows that product JWRL 700 is at 1569 customers.

Now 1569 is not the whole customer universe. To find this you need to count the different customer_ids from the Customer_master table which includes all customers.

What I want to show is the % of the value shown in the bar chart (which the sum of a column (Distribution of element (0/1) from the Distribution_data table) versus the count of the total customers.

So basically the percentage of the sum of values from one column in one table against the count of a column from another table.

Aim is to see in a second bar on the same chart that 1569 is actually 90% of the total customers.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IX
Super User IX

Re: How to show the % of a column sum in one table vs the count value of a column from another

Try New measures

custoomer for product = calculate(count(Distribution_Data[customer_ID])
overall customers = calculate(count(Customer_Master[ID]),all(Distribution_Data))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
Highlighted
Super User IX
Super User IX

Re: How to show the % of a column sum in one table vs the count value of a column from another

Try New measures

custoomer for product = calculate(count(Distribution_Data[customer_ID])
overall customers = calculate(count(Customer_Master[ID]),all(Distribution_Data))

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Community Support
Community Support

Re: How to show the % of a column sum in one table vs the count value of a column from another

hi @Andreas_P 

You could use "ALL" Function as amitchandak said to get it. here are two blog for you refer to:

https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept...

https://radacad.com/now-you-see-me-use-cases-of-all-dax-function-in-power-bi

If you still have problem, please share a simple pbix file and your expected output.

 

Regards,

Lin

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors